-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow table/column comments to be specified in the model #15767
Allow table/column comments to be specified in the model #15767
Conversation
f437a8c
to
7fd255a
Compare
We've also had a request to add these by-convention based on |
src/EFCore.Relational/Extensions/RelationalEntityTypeBuilderExtensions.cs
Outdated
Show resolved
Hide resolved
src/EFCore.Relational/Extensions/RelationalEntityTypeExtensions.cs
Outdated
Show resolved
Hide resolved
You also need to add a check to |
e4336a2
to
1578006
Compare
@AndriySvyryd @bricelam This should be good to go. Let me know if I've missed anything else. |
faddf11
to
b1be679
Compare
src/EFCore.Relational/Infrastructure/RelationalModelValidator.cs
Outdated
Show resolved
Hide resolved
@@ -249,6 +249,19 @@ protected virtual void ValidateDefaultValuesOnKeys([NotNull] IModel model, [NotN | |||
otherKey.Properties.Format())); | |||
} | |||
|
|||
var currentComment = entityType.GetComment() ?? ""; | |||
var previousComment = nextEntityType.GetComment() ?? ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can skip validation on null
comments, just store the first non-null one and compare every other one against it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like this?
src/EFCore.SqlServer/Migrations/SqlServerMigrationsSqlGenerator.cs
Outdated
Show resolved
Hide resolved
937f79a
to
3da02b2
Compare
Thanks for your contribution! |
Summary of the changes
Fixes #15037