Update dbfirst

This commit is contained in:
sunkaixuan 2024-06-26 15:49:03 +08:00
parent a6dfa8b230
commit 34ba00e3ca

View File

@ -329,7 +329,7 @@ namespace SqlSugar
} }
PropertyText = PropertyDescriptionText + PropertyText; PropertyText = PropertyDescriptionText + PropertyText;
classText = classText.Replace(DbFirstTemplate.KeyPropertyName, PropertyText + (isLast ? "" : ("\r\n" + DbFirstTemplate.KeyPropertyName))); classText = classText.Replace(DbFirstTemplate.KeyPropertyName, PropertyText + (isLast ? "" : ("\r\n" + DbFirstTemplate.KeyPropertyName)));
if (ConstructorText.HasValue() && item.DefaultValue != null) if (ConstructorText.HasValue() && item.DefaultValue != null&&item.IsIdentity!=true)
{ {
var hasDefaultValue = columns.Skip(index + 1).Any(it => it.DefaultValue.HasValue()); var hasDefaultValue = columns.Skip(index + 1).Any(it => it.DefaultValue.HasValue());
if (item.DefaultValue.EqualCase("CURRENT_TIMESTAMP")) if (item.DefaultValue.EqualCase("CURRENT_TIMESTAMP"))