1. 数据库的主键和外键类型一定要一致;

2.数据库中的表的类型要是InnoDB类型的,可在配置文件中加上:default-table-type=InnoDB

3.

alter table table2 add constraint FK_Reference_1 foreign key (foreignID)
references table1 (ID) on delete CASCADE on update restrict;

红色标记不能用restrict

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-07
  • 2022-01-27
  • 2021-12-06
  • 2021-10-22
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2018-09-25
  • 2021-07-16
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案