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

Migrations: No default value provided when column altered to required #19882

Closed
bricelam opened this issue Feb 11, 2020 · 0 comments
Closed

Migrations: No default value provided when column altered to required #19882

bricelam opened this issue Feb 11, 2020 · 0 comments
Assignees
Labels
area-migrations closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. good first issue This issue should be relatively straightforward to fix. poachable type-bug
Milestone

Comments

@bricelam
Copy link
Contributor

(From @lauxjpn)

Why is an empty default value generated for a required string property for AddColumn, while it is not generated for AlterColumn when an existing non-required string property is made required by the user?

(This is internal EF Core behavior that should be reproducible across all database providers. I tested it with Pomelo and SQL Server.)

Its this inconsistent behavior, that makes me suspicious about the AddColumn generation in the first place (or it could just mean, that is has a purpose that was just missed to be implemented for AlterColumn).

@bricelam bricelam self-assigned this Feb 11, 2020
@ajcvickers ajcvickers added this to the 5.0.0 milestone Feb 14, 2020
@bricelam bricelam added the good first issue This issue should be relatively straightforward to fix. label Mar 11, 2020
bricelam added a commit to bricelam/efcore that referenced this issue Jul 23, 2020
Changes:
- Synthesize DEFAULT value when column altered to NOT NULL (fixes dotnet#19882)
- SQL Server: Rebuild indexes when column collation is altered (fixes dotnet#21547)
bricelam added a commit to bricelam/efcore that referenced this issue Jul 23, 2020
Changes:
- Synthesize DEFAULT value when column altered to NOT NULL (fixes dotnet#19882)
- SQL Server: Rebuild indexes when column collation is altered (fixes dotnet#21547)
@bricelam bricelam added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Jul 23, 2020
@bricelam bricelam modified the milestones: 5.0.0, 5.0.0-preview8 Jul 23, 2020
bricelam added a commit to bricelam/efcore that referenced this issue Jul 24, 2020
Changes:
- Synthesize DEFAULT value when column altered to NOT NULL (fixes dotnet#19882)
- SQL Server: Rebuild indexes when column collation is altered (fixes dotnet#21547)
bricelam added a commit to bricelam/efcore that referenced this issue Jul 24, 2020
Changes:
- Synthesize DEFAULT value when column altered to NOT NULL (fixes dotnet#19882)
- SQL Server: Rebuild indexes when column collation is altered (fixes dotnet#21547)
@ajcvickers ajcvickers modified the milestones: 5.0.0-preview8, 5.0.0 Nov 7, 2020
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. good first issue This issue should be relatively straightforward to fix. poachable type-bug
Projects
None yet
Development

No branches or pull requests

2 participants