Código MySQL:
Ver original
Executing SQL script in server ERROR: Error 1022: Can't write; duplicate key in table 'tbl_producto' SQL Code: -- ----------------------------------------------------- -- Table `mydb`.`tbl_producto` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `mydb`.`tbl_producto` ( `id_producto` INT NOT NULL AUTO_INCREMENT, `id_laboratorio` INT NOT NULL, `nombre_producto` VARCHAR(30) NOT NULL, `numero_registro` VARCHAR(45) NOT NULL, `fecha_renovacion` VARCHAR(45) NOT NULL, PRIMARY KEY (`id_producto`), INDEX `id_laboratorio_idx` (`id_laboratorio` ASC), CONSTRAINT `id_laboratorio` FOREIGN KEY (`id_laboratorio`) REFERENCES `mydb`.`tbl_laboratorio` (`id_laboratorio`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB SQL script execution finished: statements: 10 succeeded, 1 failed Fetching back view definitions in final form. Nothing to fetch
Este es mi script
Código MySQL:
Ver original
-- MySQL Workbench Forward Engineering -- ----------------------------------------------------- -- Schema mydb -- ----------------------------------------------------- -- ----------------------------------------------------- -- Schema mydb -- ----------------------------------------------------- -- ----------------------------------------------------- -- Table `mydb`.`tbl_estado` -- ----------------------------------------------------- -- ----------------------------------------------------- -- Table `mydb`.`tbl_laboratorio` -- ----------------------------------------------------- -- ----------------------------------------------------- -- Table `mydb`.`tbl_registro` -- ----------------------------------------------------- CONSTRAINT `id_laboratorio` CONSTRAINT `id_estado` -- ----------------------------------------------------- -- Table `mydb`.`id_roles` -- ----------------------------------------------------- -- ----------------------------------------------------- -- Table `mydb`.`tbl_usuarios` -- ----------------------------------------------------- CONSTRAINT `id_rol` -- ----------------------------------------------------- -- Table `mydb`.`tbl_producto` -- ----------------------------------------------------- CONSTRAINT `id_laboratorio` -- ----------------------------------------------------- -- Table `mydb`.`tbl_tramite` -- ----------------------------------------------------- -- ----------------------------------------------------- -- Table `mydb`.`tbl_actualizacion` -- ----------------------------------------------------- CONSTRAINT `id_producto` CONSTRAINT `id_tramite` CONSTRAINT `id_estado` -- ----------------------------------------------------- -- Table `mydb`.`tbl_renovacion` -- ----------------------------------------------------- CONSTRAINT `id_producto` CONSTRAINT `id_estado`