Home
Sign Up
Sign In
V2EX
›
.NET
ef core 关联不上的属性默认是用 NULL 表示,怎么改成用 0 表示?(因为有一个运行了几年的 PHP 老系统用的是 0,要继承他的数据库)直接把默认值改成 0 的话会提示外键错误。
edis0n0
·
Dec 31, 2022
· 2258 views
This topic created in 1407 days ago, the information mentioned may be changed or developed.
外键
默认
null
PHP
2 replies
•
2023-01-28 23:34:57 +08:00
hervey0424
Jan 1, 2023
1
类型是 int 的默认就是 0 啊, int?的才是 null
whevether
Jan 28, 2023
2
别用外键关联啊。include 关联.
About
·
Help
·
Advertise
·
Blog
·
API
·
FAQ
·
Privacy
·
Solana
·
1431 Online
Highest 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 29ms ·
UTC 16:12
·
PVG 00:12
·
LAX 08:12
·
JFK 11:12
♥ Do have faith in what you're doing.
❯