CREATE TABLE `CompanyQualification2TextType`
(
`CQ2S_ID` VARCHAR(32) NOT NULL,
`CQ2S_CompanyQualificationID` VARCHAR(32) NOT NULL,
`CQ2S_TextTypeID` VARCHAR(32) NOT NULL,
INDEX `CQ2S_TextTypeID` (`CQ2S_TextTypeID`),
INDEX `CQ2S_CompanyQualificationID` (`CQ2S_CompanyQualificationID`),
CONSTRAINT `CQ2S_CompanyQualificationID`
FOREIGN KEY (`CQ2S_CompanyQualificationID`)
REFERENCES `CompanyQualification` (`CQ_ID`),
CONSTRAINT `CQ2S_TextTypeID`
FOREIGN KEY (`CQ2S_TextTypeID`)
REFERENCES `texttype` (`TT_ID`)
)
COLLATE='utf8_general_ci'
ENGINE=INNODB;
答案 0 :(得分:0)
问题是foreign key
的名称不能与整个模型中的another foreign key
相同。
想象一下这种情况
Catalog --> Supplier
Product --> Supplier
如果供应商的表目录中的外键名称为supplier
,并且您在产品表中分配了相同的名称,则外键名称将为collide
。
您需要以不同方式命名..
例如:
catalog_supplier product_supplier