El error me da al crear la tabla privates_zones
Código
-- ----------------------------------------------------- -- Table `mydb`.`guest_zones` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `mydb`.`guest_zones` ( `player_name` VARCHAR(45) NOT NULL , `zone_name` VARCHAR(45) NOT NULL , PRIMARY KEY (`player_name`, `zone_name`) ) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mydb`.`privates_zones` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `mydb`.`privates_zones` ( `zone_name` VARCHAR(45) NOT NULL , `player_name` VARCHAR(45) NOT NULL , `price` INT NULL , PRIMARY KEY (`zone_name`) , CONSTRAINT `fk_privates_zones_guest_zones1` FOREIGN KEY (`zone_name` ) REFERENCES `mydb`.`guest_zones` (`zone_name` ) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `mydb`.`users` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `mydb`.`users` ( `player_name` VARCHAR(45) NOT NULL , `vip` TINYINT(1) NULL , PRIMARY KEY (`player_name`) , CONSTRAINT `fk_users_privates_zones1` FOREIGN KEY (`player_name` ) REFERENCES `mydb`.`privates_zones` (`player_name` ) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB;
Espero sepáis resolverme la duda.