修复CodeFirst创建表Bug

This commit is contained in:
dailyccc 2022-12-09 10:46:38 +08:00
parent 3dd00e96ef
commit 1e232e7191

View File

@ -491,13 +491,20 @@ where a.database in ({0}) and a.table in ({1})", tboldname ?? tbname);
} }
} }
string CkNullablePrimaryAdapter(string dbType, bool isPrimary)
{
return isPrimary
? dbType.Replace("Nullable(", "").Replace(")", "")
: dbType.Replace(" NOT NULL", "");
}
string CkNullableAdapter(string dbType, bool isPrimary) string CkNullableAdapter(string dbType, bool isPrimary)
{ {
return isPrimary return isPrimary
? dbType.Replace("Nullable(", "").Replace(") NOT NULL", "") ? dbType.Replace("Nullable(", "").Replace(")","").Replace(" NOT NULL", "")
: dbType.Replace(" NOT NULL", ""); : dbType.Replace(" NOT NULL", "");
} }
string CkIntAdapter(string dbType) string CkIntAdapter(string dbType)
{ {
var result = dbType; var result = dbType;