Forums | Mahara Community

Open Discussion /
create an INNODB table


anonymous profile picture
Account deleted
Posts: 1

20 May 2009, 7:06

Hello,

I have a problem to create an INNODB table ! I wrote this :

CREATE table HOMOLOGIE(IDunik Int AUTO_INCREMENT primary key, EstName Varchar(10), UGID Varchar(20), IDoligo Varchar(20), score Int(3), percent Float(5,2), GSymbol Varchar(20), CONSTRAINT foreign key (GSymbol) REFERENCES GENE(GID), CONSTRAINT foreign key (IDoligo) REFERENCES OLIGO(Name)) TYPE=INNODB;

 And I have this error : 

 ------------------------
LATEST FOREIGN KEY ERROR
------------------------
090520 15:28:43 Error in foreign key constraint of table mysql/HOMOLOGIE:
foreign key (IDoligo) REFERENCES OLIGO(Name), primary key (IDunik)) TYPE=INNODB:
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.

Help me please

Thanks in advance 

1 result