Hi Chris,

Chris Hoover wrote:
Here is the error from the show innodb status:

070523 15:39:39 Error in foreign key constraint of table mysql/#sql-d70_22:

   FOREIGN KEY (tab_id, class) REFERENCES system_tabs(tab_id, class):
Cannot find an index in the referenced table where the
referenced columns appear as the first columns, or column types
in the table and the referenced table do not match for constraint.
Note that the internal storage type of ENUM and SET changed in
tables created with >= InnoDB-4.1.12, and such columns in old tables
cannot be referenced by such columns in new tables.
See
http://dev.mysql.com/doc/refman/5.0/en/innodb-foreign-key-constraints.html
for correct foreign key definition.


I don't understand this since the primary key for system_tabs is tab_id,
class and clinic_consent_form has the index fk_idx on tab_id, class.  What
is mysql complaining about?

I missed it the first time I looked, but your data types are different:

> CREATE TABLE `system_tabs` (
>  `tab_id` bigint(20) unsigned NOT NULL auto_increment,
>  `class` int(11) NOT NULL,

>  `tab_id` bigint(20) NOT NULL,
>  `class` int(11) NOT NULL,

Unsigned is a different data type.

Cheers
Baron

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to