Skip to content

Commit 37638a5

Browse files
authored
Merge pull request #1372 from d4ilys/master
修复ClickHouse CodeFirst创建表Bug
2 parents 80cfa45 + 1e232e7 commit 37638a5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Providers/FreeSql.Provider.ClickHouse/ClickHouseCodeFirst.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,13 +491,20 @@ object LocalExecuteScalar(string db, string sql)
491491
}
492492
}
493493

494+
string CkNullablePrimaryAdapter(string dbType, bool isPrimary)
495+
{
496+
return isPrimary
497+
? dbType.Replace("Nullable(", "").Replace(")", "")
498+
: dbType.Replace(" NOT NULL", "");
499+
}
494500
string CkNullableAdapter(string dbType, bool isPrimary)
495501
{
496502
return isPrimary
497-
? dbType.Replace("Nullable(", "").Replace(") NOT NULL", "")
503+
? dbType.Replace("Nullable(", "").Replace(")","").Replace(" NOT NULL", "")
498504
: dbType.Replace(" NOT NULL", "");
499505
}
500506

507+
501508
string CkIntAdapter(string dbType)
502509
{
503510
var result = dbType;

0 commit comments

Comments
 (0)