首先是代码中的PK和FK命名约定

时间:2015-03-15 04:41:53

标签: sql-server entity-framework

我喜欢我的pk和fk列没有" _dbo。"作为名称的一部分。首先是实体框架代码中是否有可用的配置?

例如,我有一个名为PunchCard的表。 Pk被命名为PK_dbo.PunchCard。我希望它是PK_PunchCard

对于FK,它会说FK_dbo.PunchCard_dbo.Employee_EmployeetId。我在找它说FK_PunchCard_Employee。

有可能吗?

enter image description here

1 个答案:

答案 0 :(得分:0)

Which Sql server edition are you using. I have created the table with the same name dbo.PunchCard with one column id . Another way is to define a constraint for primary key where you can give name as you want.请参阅随附的输出PK Naming convention

相关问题