-
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
Default value constraint re-added when using .HasComment() #24272
Labels
area-migrations
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
regression
Servicing-approved
type-bug
Milestone
Comments
Thanks for reporting this - I can reproduce it and will look into it. |
/cc @bricelam to take a look. |
This is a regression from 3.1 where we always dropped the default constraint every alter. |
roji
added a commit
that referenced
this issue
Mar 1, 2021
roji
added a commit
that referenced
this issue
Mar 1, 2021
roji
added a commit
that referenced
this issue
Mar 1, 2021
5.0.x patch proposal in #24305 |
roji
added a commit
that referenced
this issue
Mar 10, 2021
roji
added a commit
that referenced
this issue
Mar 10, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area-migrations
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
regression
Servicing-approved
type-bug
If I use
.HasComment
on a property which also has a default value, then the migration tries toADD
the constraint even if its already there.The migration looks like this:
As the
defaultValueSql
andoldDefaultValueSql
are identical I wouldn't expect a ALTER TABLE in my migration script.But the migration script looks like this:
This results in the following error on on runtime:
EF CLI 5.0.3 (dotnet CLI)
Microsoft.EntityFrameworkCore 5.0.3
Microsoft.EntityFrameworkCore.SqlServer 5.0.3
MSSQL
The text was updated successfully, but these errors were encountered: