Generating MigrationHistory table in reverse engineered code first

c# ef-migrations entity-framework entity-framework-6

Accepted Answer

A baseline migration of the current items must be established. So, the following should be the initial migration you create:

add-migration Initial -IgnoreChanges

By selecting ignore changes, EF is instructed to only save a snapshot of the live database. Now, the current tables won't be included in any future migrations (just the changes). Since EF will see the record in __MigrationHistory or deploy to a new, empty database, this would enable you to keep updating your current database.

Look at the This is the part about the engine.

1
4/27/2017 7:21:18 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow