mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 20:38:16 +08:00
- 修复 CodeFirst IsPrimary NOT NULL 生成,sqlite 可以插入 NULL 到主键;
This commit is contained in:
@ -516,7 +516,7 @@ namespace FreeSql.Internal
|
||||
foreach (var col in trytb.Primarys)
|
||||
{
|
||||
col.Attribute.IsNullable = false;
|
||||
col.Attribute.DbType = col.Attribute.DbType.Replace("NOT NULL", "").Replace(" NULL", "").Trim();
|
||||
col.Attribute.DbType = col.Attribute.DbType.Replace("NOT NULL", "").Replace(" NULL", "").Trim() + " NOT NULL"; //sqlite 主键也可以插入 null
|
||||
}
|
||||
foreach (var col in trytb.Columns.Values)
|
||||
{
|
||||
@ -956,7 +956,7 @@ namespace FreeSql.Internal
|
||||
foreach (var col in tbmid.Primarys)
|
||||
{
|
||||
col.Attribute.IsNullable = false;
|
||||
col.Attribute.DbType = col.Attribute.DbType.Replace("NOT NULL", "").Replace(" NULL", "").Trim();
|
||||
col.Attribute.DbType = col.Attribute.DbType.Replace("NOT NULL", "").Replace(" NULL", "").Trim() + " NOT NULL"; //sqlite 主键也可以插入 null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user