且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

UPDATE语句与FOREIGN KEY约束冲突

更新时间:2023-02-25 21:59:00

AdministratorId为int类型,因此默认值为0.除非数据库中的Administrator记录的AdministratorId为0,否则它将中断您的外键约束.

AdministratorId is type int, so will have a default value of 0. Unless you've got an Administrator record in your database with AdministratorId as 0, this will break your foreign key constraint.

将AdministratorId的类型更改为int吗?应在Application类上解决此问题.

Changing the type of AdministratorId to int? on the Application class should resolve this.