创建数据库时:错误代码:1215。无法添加外键约束

While creating database: Error Code: 1215. Cannot add foreign key constraint

当我创建数据库时,我在为该数据库创建 "main" table 时遇到了一些困难。

我以为外键和主键之间存在类型差异,但没有。

所以有人可以帮我吗?一定有一些我忽略的东西,但我找不到问题所在。

[code]
-- -----------------------------------------------------
-- Table `boat`.`terms_and_conditions`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `boat`.`terms_and_conditions` (
  `Terms_And_Conditions_Id` INT NOT NULL,
  `Terms_And_Conditions_Doc` VARCHAR(255) NULL DEFAULT NULL,
  `Terms_And_Conditions_Date` DATE NULL DEFAULT NULL,
  PRIMARY KEY (`Terms_And_Conditions_Id`))
ENGINE = InnoDB;

-- -----------------------------------------------------
-- Table `boat`.`player`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `boat`.`player` (
  `Player_Id` INT NOT NULL,
  `Player_Firstname` VARCHAR(45) NULL DEFAULT NULL,
  `Player_Lastname` VARCHAR(45) NULL DEFAULT NULL,
  `Player_Password` VARCHAR(45) NULL,
  `Player_Budget` DOUBLE NULL,
  `Terms_Id` INT NOT NULL,
  PRIMARY KEY (`Player_Id`),
  INDEX `fk_player_terms_and_conditions1_idx` (`Terms_Id` ASC),
  CONSTRAINT `fk_player_player_result1`
    FOREIGN KEY (`Player_Id`)
    REFERENCES `boat`.`player_result` (`Player_Id`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `fk_player_supervisor_player1`
    FOREIGN KEY (`Player_Id`)
    REFERENCES `boat`.`supervisor_player` (`Player_id`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  CONSTRAINT `fk_player_terms_and_conditions1`
    FOREIGN KEY (`Terms_Id`)
    REFERENCES `boat`.`terms_and_conditions` (`Terms_And_Conditions_Id`)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB;

问题出在播放器 Table 的主键中。它被配置为充当其他表的外键。