In my Entity Framework Code First project, if I run the
update-database
command through the Package Manage Console, my Seed()
method runs successfully. If, however, I run the command with the -script parameter:
update-database -script
...the Seed() method is not called and the resulting SQL does not contain the SQL commands for seeding the database. This behaviour is repeatable. I'm attempting to create a full DB Script for deployment.
Why is there a discrepancy between the SQL Commands run with -script
and without it, and how can I get update-database
to run the Seed()
method when using the -script
switch?