I have created a new application using Entity Framework 4.3 database migrations. The migrations work great from the package manager console using the “update-database” command.
Now I want to run the database migrations every time the application is built using Team City, it looks like I need to create a powershell script that will do this.
Can anyone point me to some instructions on how to get the package manager commands to run from the command line, or powershell? All I can find is instructions on how to do this via the package manager console, which I don’t know how to run from a Team City build step.
migrate.exe is what I was looking for, it is found in “packages\EntityFramework.4.3.1\tools”.
Add a new build step in Team City using:
Runner type: command line
Command executable: packages\EntityFramework.4.3.1\tools\migrate.exe
Command parameters: MyApplicationName /StartupDirectory:MyApplicationName\bin