Changes between Initial Version and Version 8 of Ticket #2720
- Timestamp:
- Sep 26, 2006, 11:29:39 AM (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #2720 – Description
initial v8 1 1 Django uses the following syntax to define foreign keys under MySQL/InnoDB: 2 2 3 {{{ 3 4 CREATE TABLE `system_script_queue` ( 4 5 `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, … … 7 8 `system_script_id` integer NOT NULL REFERENCES `system_script` (`id`) 8 9 ); 10 }}} 9 11 10 12 Using that syntax, maybe 1/3 of my foreign key constraints are being ignored by the DB. … … 12 14 If I'm reading this tech note correctly (http://dev.mysql.com/doc/refman/5.0/en/example-foreign-keys.html), that's the wrong syntax to use. The correct syntax is this one: 13 15 16 {{{ 14 17 CREATE TABLE `system_script_queue` ( 15 18 `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, … … 19 22 foreign key (`system_script_id`) references `system_script` (`id`) 20 23 ); 24 }}} 21 25 22 26 Using this syntax, all of my foreign key constraints seem to be successfully created.