Skip to content

Migrations: Default value not scaffolded for non nullable fields causing error #1275

@suhasj

Description

@suhasj

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions