I receive the following error when I forward engineer my database:
ERROR: Error 1022: Can't write; duplicate key in table 'recipes'
Any suggestions?
I researched the question in stackoverflow and I thought if I changed the name of some my foreign keys from other tables (some of which have the same foreign key names) there would not be an error. The same error code persists. The schema for my database shows only 2 out of the eight tables.
Executing SQL script in server
ERROR: Error 1022: Can't write; duplicate key in table 'recipes'
SQL Code:
-- -----------------------------------------------------
-- Table `our_recipes`.`recipes`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `our_recipes`.`recipes` (
`recipe_id` INT NOT NULL,
`chef_id` INT NOT NULL,
`recipe_name` CHAR(25) NULL,
`description` LONGTEXT NULL,
`min_prep` VARCHAR(25) NULL,
`total_time` INT NULL,
`servings_min` VARCHAR(25) NULL,
`servings_max` VARCHAR(45) NULL,
`directions` VARCHAR(45) NULL,
`website_id1` VARCHAR(25) NOT NULL,
PRIMARY KEY (`recipe_id`),
INDEX `chef_id_idx` (`chef_id` ASC),
INDEX `website_id_idx` (`website_id1` ASC),
UNIQUE INDEX `recipe_id_UNIQUE` (`recipe_id` ASC),
CONSTRAINT `chef_id`
FOREIGN KEY (`chef_id`)
REFERENCES `our_recipes`.`chef` (`chef_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `website_id`
FOREIGN KEY (`website_id1`)
REFERENCES `our_recipes`.`website` (`website_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
I expected to have eight tables in database schema. I also expected no errors.