Thursday, September 13, 2012

Entity Framework Code First Migrations

Entity Framework Code First Migrations

Code First Migrations has two primary commands.

  • Add-Migration will scaffold the next migration based on changes you have made to your model since the last migration was created
  • Update-Database will apply any pending migrations to the database"

Tools –> Library Package Manager –> Package Manager Console

Essentially, every change in Model needs to be manually registered by a (tool generated) code,
and that code is then run as needed when app is started.