2009年2月24日星期二

[fw-db] No reference from table Demands to table Types

Hi,

I get the above exception, though I have set up the relationships in
the DB. Here it is:

mysql> show create table demands\G
*************************** 1. row ***************************
Table: demands
Create Table: CREATE TABLE `demands` (
`id` int(11) NOT NULL auto_increment,
`date` timestamp NOT NULL default CURRENT_TIMESTAMP,
`type` int(11) default NULL,
`device` int(11) default NULL,
`description` text collate utf8_hungarian_ci,
`priority` int(11) default NULL,
`public` varchar(1) collate utf8_hungarian_ci default NULL,
`user` int(11) default NULL,
`state` int(11) default NULL,
PRIMARY KEY (`id`),
KEY `type` (`type`),
KEY `device` (`device`),
KEY `user` (`user`),
KEY `state` (`state`),
KEY `priority` (`priority`),
CONSTRAINT `demands_ibfk_1` FOREIGN KEY (`type`) REFERENCES `types` (`id`),
CONSTRAINT `demands_ibfk_2` FOREIGN KEY (`device`) REFERENCES
`devices` (`id`),
CONSTRAINT `demands_ibfk_3` FOREIGN KEY (`user`) REFERENCES `users` (`id`),
CONSTRAINT `demands_ibfk_4` FOREIGN KEY (`state`) REFERENCES `states` (`id`),
CONSTRAINT `demands_ibfk_5` FOREIGN KEY (`priority`) REFERENCES
`priorities` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci

What's wrong?


Thanks,
Ádám

没有评论: