MySQL错误1215:无法添加外键约束
Executing SQL script in server ERROR: Error 1215: Cannot add foreign key constraint-- ------------------------------------------------------- Table `Alternative_Pathways`.`Clients_has_Staff`-- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `Alternative_Pathways`.`Clients_has_Staff` ( `Clients_Case_Number` INT NOT NULL , `Staff_Emp_ID` INT NOT NULL , PRIMARY KEY (`Clients_Case_Number`, `Staff_Emp_ID`) , INDEX `fk_Clients_has_Staff_Staff1_idx` (`Staff_Emp_ID` ASC) , INDEX `fk_Clients_has_Staff_Clients_idx` (`Clients_Case_Number` ASC) , CONSTRAINT `fk_Clients_has_Staff_Clients` FOREIGN KEY (`Clients_Case_Number` ) REFERENCES `Alternative_Pathways`.`Clients` (`Case_Number` ) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_Clients_has_Staff_Staff1` FOREIGN KEY (`Staff_Emp_ID` ) REFERENCES `Alternative_Pathways`.`Staff` (`Emp_ID` ) ON DELETE NO ACTION ON UPDATE NO ACTION)ENGINE = InnoDB
CREATE TABLE IF NOT EXISTS `Alternative_Pathways`.`Clients` ( `Case_Number` INT NOT NULL , `First_Name` CHAR(10) NULL , `Middle_Name` CHAR(10) NULL , `Last_Name` CHAR(10) NULL , `Address` CHAR(50) NULL , `Phone_Number` INT(10) NULL , PRIMARY KEY (`Case_Number`) )ENGINE = InnoDBCREATE TABLE IF NOT EXISTS `Alternative_Pathways`.`Staff` ( `Emp_ID` INT NOT NULL , `First_Name` CHAR(10) NULL , `Middle_Name` CHAR(10) NULL , `Last_Name` CHAR(10) NULL , PRIMARY KEY (`Emp_ID`) )ENGINE = InnoDB
慕雪6442864
www说
人到中年有点甜
相关分类