关于sql导入MySQL运行报错:“[Err] 1022 - Can’t write; duplicate key in table ‘#sql-1bec_23’”
powerdesign数据库概念模型转物理模型,生成sql代码时容易出现以上1022错误,具体原因是外键重名。我们只要在自定义外键名转换成物理模型时,更改‘’多对多‘’自动生成表关系两边的外键名就好
alter table coupons_user add constraint FK_coupons_user foreign key (user_id)
references t_user (user_id) on delete restrict on update restrict;
[Err] 1022 - Can’t write; duplicate key in table ‘#sql-1bec_23’