MySQL Forums
Forum List  »  InnoDB

Re: Can't create table with Foreign Keys - errno:150??
Posted by: aftab khan
Date: February 26, 2009 05:16AM

This will work!

CREATE TABLE Contact_Organisation (
org_ID INT(10) UNSIGNED NOT NULL,
c_type enum('organisation','individual') NOT NULL,
name VARCHAR(100) NULL ,
web VARCHAR(100) NULL ,
PRIMARY KEY (org_ID),
FOREIGN KEY (org_ID,c_type) REFERENCES Contacts (`contact_ID`,`contact_type`)
ON DELETE CASCADE
ON UPDATE CASCADE
)ENGINE = INNODB;

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Can't create table with Foreign Keys - errno:150??
2173
February 26, 2009 05:16AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.