Skip to content

Commit

Permalink
SQL default value was always being set
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexis Santana committed Aug 3, 2023
1 parent c0741d1 commit b1097c0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/DslPackage/TextTemplates/EFCore5ModelGenerator.ttinclude
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,10 @@
break;
}
}
else
else if (string.IsNullOrWhiteSpace(modelAttribute.DatabaseDefaultValue))
{
segments.Add($"HasDefaultValueSql(\"{modelAttribute.DatabaseDefaultValue}\")");
}

if (!string.IsNullOrEmpty(modelAttribute.DatabaseCollation)
&& modelAttribute.DatabaseCollation != modelRoot.DatabaseCollationDefault
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,10 @@ protected override List<string> GatherModelAttributeSegments(ModelAttribute mode
break;
}
}
else
else if (string.IsNullOrWhiteSpace(modelAttribute.DatabaseDefaultValue))
{
segments.Add($"HasDefaultValueSql(\"{modelAttribute.DatabaseDefaultValue}\")");
}

if (!string.IsNullOrEmpty(modelAttribute.DatabaseCollation)
&& modelAttribute.DatabaseCollation != modelRoot.DatabaseCollationDefault
Expand Down

0 comments on commit b1097c0

Please sign in to comment.