I am not an expert on databases but I'm modeling a database on mysqlworkbench 8.0.13 and when I try to run the script it breaks at this table(regimes). I can't figure out what KEY 'NAME' it is referring to. There's no key called name on this table.
I use this table's id as FK on two other tables. And both relationships are ONE-TO-MANY. But I don't think this should be a problem. Can anyone please be so kind as to point me in the right direction to solve this problem?
ERROR LOG:
Executing SQL script in server
ERROR: Error 1062: Duplicate entry 'mydb/regimes' for key 'name'
SQL Code:
CREATE TABLE IF NOT EXISTS `mydb`.`regimes` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`description` VARCHAR(255) NOT NULL,
`created_at` TIMESTAMP NULL DEFAULT NULL,
`updated_at` TIMESTAMP NULL DEFAULT NULL,
`deleted_at` TIMESTAMP NULL DEFAULT NULL,
PRIMARY KEY (`id`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci
SQL script execution finished: statements: 49 succeeded, 1 failed
Fetching back view definitions in final form.
Nothing to fetch
COMPANIES TABLE
CREATE TABLE IF NOT EXISTS `mydb`.`vacancies` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`company_id` INT UNSIGNED NOT NULL,
`manager_id` INT UNSIGNED NOT NULL,
`regime_id` INT UNSIGNED NOT NULL,
`vacancy_status_id` INT UNSIGNED NOT NULL,
`vacancy_type_id` INT UNSIGNED NOT NULL,
`title` VARCHAR(255) NOT NULL,
`area` VARCHAR(255) NOT NULL,
`description` TEXT NULL DEFAULT NULL,
`exam_filename` VARCHAR(255) NULL DEFAULT NULL,
`workload` VARCHAR(255) NOT NULL,
`remuneration` VARCHAR(255) NOT NULL,
`quantity` INT NOT NULL,
`city` VARCHAR(255) NOT NULL,
`soft_skills` VARCHAR(500) NOT NULL,
`level` VARCHAR(255) NOT NULL,
`specialty` VARCHAR(255) NOT NULL,
`skills` VARCHAR(2000) NULL DEFAULT NULL,
`help` TINYINT(1) NOT NULL,
`created_at` TIMESTAMP NULL DEFAULT NULL,
`updated_at` TIMESTAMP NULL DEFAULT NULL,
`deleted_at` TIMESTAMP NULL DEFAULT NULL,
PRIMARY KEY (`id`),
INDEX `fk_vacancies_companies1_idx` (`company_id` ASC) VISIBLE,
INDEX `fk_vacancies_managers1_idx` (`manager_id` ASC) VISIBLE,
INDEX `fk_vacancies_vacancy_types1_idx` (`vacancy_type_id` ASC) VISIBLE,
INDEX `fk_vacancies_vacancy_statuses1_idx` (`vacancy_status_id` ASC) VISIBLE,
INDEX `fk_vacancies_regimes1_idx` (`regime_id` ASC) VISIBLE,
CONSTRAINT `fk_vacancies_companies1`
FOREIGN KEY (`company_id`)
REFERENCES `mydb`.`companies` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_vacancies_managers1`
FOREIGN KEY (`manager_id`)
REFERENCES `mydb`.`managers` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_vacancies_vacancy_types1`
FOREIGN KEY (`vacancy_type_id`)
REFERENCES `mydb`.`vacancy_types` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_vacancies_vacancy_statuses1`
FOREIGN KEY (`vacancy_status_id`)
REFERENCES `mydb`.`vacancy_statuses` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_vacancies_regimes1`
FOREIGN KEY (`regime_id`)
REFERENCES `mydb`.`regimes` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
PROFESSIONAL_PROFILES
CREATE TABLE IF NOT EXISTS `mydb`.`professional_profiles` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`talent_id` INT UNSIGNED NOT NULL,
`regime_id` INT UNSIGNED NOT NULL,
`vacancy_type_id` INT UNSIGNED NOT NULL,
`specialty` VARCHAR(255) NOT NULL,
`level` VARCHAR(255) NOT NULL,
`available` TINYINT(1) NOT NULL,
`curriculum_filename` VARCHAR(255) NOT NULL,
`soft_skills` VARCHAR(500) NOT NULL,
`relocation` TINYINT(1) NOT NULL,
`current_company` VARCHAR(255) NULL DEFAULT NULL,
`current_remuneration` VARCHAR(255) NULL DEFAULT NULL,
`intended_remuneration` VARCHAR(255) NULL DEFAULT NULL,
`remote` TINYINT(1) NOT NULL,
`meeting_start` TIME NOT NULL,
`meeting_end` TIME NOT NULL,
`created_at` TIMESTAMP NULL DEFAULT NULL,
`updated_at` TIMESTAMP NULL DEFAULT NULL,
`deleted_at` TIMESTAMP NULL DEFAULT NULL,
PRIMARY KEY (`id`),
INDEX `fk_professional_profiles_talents1_idx` (`talent_id` ASC) VISIBLE,
INDEX `fk_professional_profiles_vacancy_types1_idx` (`vacancy_type_id` ASC) VISIBLE,
INDEX `fk_professional_profiles_regimes1_idx` (`regime_id` ASC) VISIBLE,
CONSTRAINT `fk_professional_profiles_talents1`
FOREIGN KEY (`talent_id`)
REFERENCES `mydb`.`talents` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_professional_profiles_vacancy_types1`
FOREIGN KEY (`vacancy_type_id`)
REFERENCES `mydb`.`vacancy_types` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_professional_profiles_regimes1`
FOREIGN KEY (`regime_id`)
REFERENCES `mydb`.`regimes` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB