O'Reilly logo

Code-First Development with Entity Framework by Sergey Barskiy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding migrations to an existing database

Sometimes, we have a use case where we want to add Entity Framework migrations to an existing database so that we can move from one way to handle schema changes to the migrations API. Of course, since our database is already in production, we need to let migrations know that we are starting with a known state. This is quite easy to do with another parameter to the Add-Migration commandlet: –IgnoreChanges. When we issue this command, Entity Framework will create an empty migration. It will assume that your model defined by context and entities are compatible with our database. Once you update the database by running this migration, no schema changes will take place, but a new row will be added to the

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required