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: Default value not scaffolded for non nullable fields causing error #1275

Closed
suhasj opened this issue Dec 11, 2014 · 1 comment
Closed
Assignees
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Milestone

Comments

@suhasj
Copy link

suhasj commented Dec 11, 2014

Consider a database with tables and user data. Now if I change my model to add a property, say DateTime which is non nullable. Running migrations generates the necessary code but doesn't set a default value for the column. This causes to throw an ugly EF exception when applying the migrations that there is no default value set.

This seems to have worked in EF 6.0 where a default value was set for the column

@rowanmiller
Copy link
Contributor

We didn't scaffold the code in EF6 but would add the value in later in the process. I think it would be better to scaffold it though.

@rowanmiller rowanmiller added this to the 7.0.0 milestone Jan 5, 2015
@rowanmiller rowanmiller added pri1 and removed pri0 labels Jan 5, 2015
@bricelam bricelam modified the milestones: 7.0.0-beta6, 7.0.0 Jul 1, 2015
@ajcvickers ajcvickers added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Oct 15, 2022
@ajcvickers ajcvickers modified the milestones: 1.0.0-beta6, 1.0.0 Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Projects
None yet
Development

No branches or pull requests

4 participants