Skip to content
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

[5.0.x] Fix default constraint logic in SQL Server migrations (#24274) #24305

Merged
merged 2 commits into from Mar 10, 2021

Conversation

roji
Copy link
Member

@roji roji commented Mar 1, 2021

Port of 6.0 fix #24274 to 5.0 release.

Fixes #24272

Description

An exception is thrown when generating migration SQL when a property is modified which has both a comment and a default value.

Customer Impact

This prevents users from generating SQL scripts or applying migrations in the scenario described above. Working around this isn't trivial.

How found

Reported by a customer.

Test coverage

Test coverage for this case has been added in this PR.

Regression?

Yes, from EF Core 3.1.

Risk

Low. SQL Server migrations are generally well-covered by tests, the fix is very small, and affects only the SQL Server migration SQL generator, which is a design-time component. The fix is also quirked.

@smitpatel smitpatel changed the base branch from main to release/5.0 March 1, 2021 19:15
@jamshedd
Copy link
Member

jamshedd commented Mar 4, 2021

Approved for April - 5.0.5.

@roji roji merged commit 09ec021 into release/5.0 Mar 10, 2021
@roji roji deleted the SqlServerAlterColumn5.0 branch March 10, 2021 11:56
@ajcvickers ajcvickers removed this from the 5.0.5 milestone Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Default value constraint re-added when using .HasComment()
4 participants