生成MySQL数据库表报错SQL:

alter table position add constraint FK_Reference_1 foreign key (partner_id)
      references partner (partner_id) on delete restrict on update restrict;

报错信息:

19:51:42    alter table position add constraint FK_Reference_2 foreign key (partner_id)       references partner (partner_id) on delete restrict on update restrict    Error Code: 1022. Can't write; duplicate key in table '#sql-e88_23'    0.047 sec

生成MySQL数据库表报错:Error Code: 1022. Can't write; duplicate key in table '#sql-e88_23'

解决办法:修改外键名称,如下所示:

alter table position add constraint FK_Reference_8 foreign key (partner_id)
      references partner (partner_id) on delete restrict on update restrict;

 

相关文章:

  • 2021-10-17
  • 2022-12-23
  • 2021-06-17
  • 2022-12-23
  • 2022-12-23
  • 2021-11-13
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-05-16
  • 2022-02-12
  • 2021-05-06
  • 2022-12-23
  • 2021-04-21
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案