Hi,
I'm trying to create a foreign key constraint on a new table, but I keep seeing an error. I don't see what the problem is. Can anybody help me out? At least, how do I get more information to debug this?
If this is the wrong forum, can somebody please point me to the right one? Also, I don't see how to add tags (like <pre> or
I'm trying to create a foreign key constraint on a new table, but I keep seeing an error. I don't see what the problem is. Can anybody help me out? At least, how do I get more information to debug this?
If this is the wrong forum, can somebody please point me to the right one? Also, I don't see how to add tags (like <pre> or
), so sorry for the formatting. I can edit the post if somebody tells me how to mark it up correctly. Thanks, Eric Stein CREATE TABLE `auth_user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(30) NOT NULL, `first_name` varchar(30) NOT NULL, `last_name` varchar(30) NOT NULL, `email` varchar(75) NOT NULL, `password` varchar(128) NOT NULL, `is_staff` tinyint(1) NOT NULL, `is_active` tinyint(1) NOT NULL, `is_superuser` tinyint(1) NOT NULL, `last_login` datetime NOT NULL, `date_joined` datetime NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `username` (`username`) ) ENGINE=MyISAM AUTO_INCREMENT=33 DEFAULT CHARSET=utf8$$ CREATE TABLE `tastypie_apikey` ( `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, `user_id` integer NOT NULL UNIQUE, `key` varchar(255) NOT NULL, `created` datetime NOT NULL ); 0 row(s) affected Records: 0 Duplicates: 0 Warnings: 0 ALTER TABLE `tastypie_apikey` ADD CONSTRAINT `user_id_refs_id_56bfdb62` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`); Error Code: 1215. Cannot add foreign key constraint