- 修复 CodeFirst IsNullable 迁移脚本重复 NOT NULL 语法错误;

This commit is contained in:
28810
2020-03-27 17:35:59 +08:00
parent d4e73641a4
commit dbc323a22c
13 changed files with 37 additions and 1 deletions

View File

@ -124,7 +124,7 @@ namespace FreeSql.Internal
if ((colattr.IsNullable != true || colattr.IsIdentity == true || colattr.IsPrimary == true) && colattr.DbType.Contains("NOT NULL") == false)
{
colattr.IsNullable = false;
colattr.DbType += " NOT NULL";
colattr.DbType = Regex.Replace(colattr.DbType, @"\bNULL\b", "").Trim() + " NOT NULL";
}
if (colattr.IsNullable == true && colattr.DbType.Contains("NOT NULL")) colattr.DbType = colattr.DbType.Replace("NOT NULL", "");
colattr.DbType = Regex.Replace(colattr.DbType, @"\([^\)]+\)", m =>