Browse Source

SqlServer add default value bug

pull/31/head
sunkaixuan 2 years ago
parent
commit
8c096ba2b0
  1. 2
      Src/Asp.Net/SqlSugar/Realization/SqlServer/DbMaintenance/SqlServerDbMaintenance.cs

2
Src/Asp.Net/SqlSugar/Realization/SqlServer/DbMaintenance/SqlServerDbMaintenance.cs

@ -438,7 +438,7 @@ namespace SqlSugar
defaultValue = "";
}
var template = AddDefaultValueSql;
if (defaultValue != null && defaultValue.ToLower() == "getdate()")
if (defaultValue != null && defaultValue.Replace(" ","").Contains("()"))
{
template = template.Replace("'{2}'", "{2}");
}

Loading…
Cancel
Save