I have an Asp.Net MVC app for which I'm using entity framework 6 and sql server. I'm not able to run automatic migrations in production so I run the following command to generate a script which I can pass on to the DBA:
update-database -SourceMigration $InitialDatabase -script
This generates a script to create the tables etc but not inserts for the seed data that I have defined in the Seed method of my Configuration class.
Is it possible to have EF generate script for the seed data?
It turns out EF 6.1.3 (and maybe earlier versions) ships with a tool called migrate.exe that enables the migration to run on the target server along with the data seeding. This is described at the following link and worked well for my problem: https://msdn.microsoft.com/en-gb/data/jj618307.aspx
You have to create custom DB initializer.