We have a project running EF6 and have now activated Migrations. The problem we have is that we ha a lot of Data that needs to be added to the database when it is created. This worked well until we needed to add data in the migration part so it is part becomes part of the SQL script. Because when we try and create a new database on our development machines the migration steps are done before the Initializer's seed method and some of the data in the migration step depends on that seed data.
Is there some way to just get the initial database, without any migrations, plus the Initializer's seed data? Or do we need to move the critical data to the InitialCreate mirgations Up method?
The production database will cannot be wiped at this stage and thus we need to add all new production data to the migration step.
Migrations also have a Seed method you can override that takes place after the Up() method. You can use the AddOrUpdate command in case data may exist. http://www.asp.net/web-api/overview/data/using-web-api-with-entity-framework/part-3