我从工作台中导出了一个架构,现在尝试使用该脚本在服务器中创建表,但是会出错
我尝试更改表,还尝试查找重复的foriegn键。
错误1826:重复的外键约束名称“ bank_id” SQL语句:
-表aditya
。users_has_bank
CREATE TABLE IF NOT EXISTS `aditya`.`users_has_bank` (
`users_user_id` INT NOT NULL AUTO_INCREMENT,
`bank_id` INT NOT NULL,
`user_id` INT NOT NULL,
PRIMARY KEY (`users_user_id`),
INDEX `bank_id_idx` (`bank_id` ASC) VISIBLE,
INDEX `user_id_idx` (`user_id` ASC) VISIBLE,
CONSTRAINT `bank_id`
FOREIGN KEY (`bank_id`)
REFERENCES `aditya`.`bank` (`bank_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `user_id`
FOREIGN KEY (`user_id`)
REFERENCES `aditya`.`users` (`user_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB