- 修复 参数化 Column DbType 设置特殊值时的类型判断;

This commit is contained in:
28810
2020-08-24 13:35:48 +08:00
parent d951b475d9
commit 824d60cbb2
5 changed files with 139 additions and 4 deletions

View File

@ -453,12 +453,12 @@ namespace FreeSql.Internal
foreach (var col in trytb.Primarys)
{
col.Attribute.IsNullable = false;
col.Attribute.DbType = col.Attribute.DbType.Replace("NOT NULL", "").Trim();
col.Attribute.DbType = col.Attribute.DbType.Replace("NOT NULL", "").Replace(" NULL", "").Trim();
}
foreach (var col in trytb.Columns.Values)
{
var ltp = @"\(([^\)]+)\)";
col.DbTypeText = Regex.Replace(col.Attribute.DbType.Replace("NOT NULL", "").Trim(), ltp, "");
col.DbTypeText = Regex.Replace(col.Attribute.DbType.Replace("NOT NULL", "").Replace(" NULL", "").Trim(), ltp, "");
var m = Regex.Match(col.Attribute.DbType, ltp);
if (m.Success == false) continue;
var sizeStr = m.Groups[1].Value.Trim();
@ -884,7 +884,7 @@ namespace FreeSql.Internal
foreach (var col in tbmid.Primarys)
{
col.Attribute.IsNullable = false;
col.Attribute.DbType = col.Attribute.DbType.Replace("NOT NULL", "").Trim();
col.Attribute.DbType = col.Attribute.DbType.Replace("NOT NULL", "").Replace(" NULL", "").Trim();
}
}
}