Using EF migrations I wish to automate running a migration against an environment. I know I can do this via powershell call to Update-Database, but is there a way of doing this via the framework without having to launch an external process?
Using EF migrations I wish to automate running a migration against an environment. I
Share
Yes, in your DbContext:
Where Configuration is:
You’ll still need to release a Migration file for migrations that will make changes that will result in dataloss (unless you set AutomaticMigrationDataLossAllowed to true in the Configuration class – danger!) but you can make these files using the Add-Migration command in PMC.