EFCore-ASPNetCore-WebAPI-RTM icon indicating copy to clipboard operation
EFCore-ASPNetCore-WebAPI-RTM copied to clipboard

Q: Migrations when deployed how-to

Open Allann opened this issue 9 years ago • 0 comments

Hi,

This is very useful and the effort involved in keeping it current is appreciated, but I have a question for later in the application life cycle.

When development is finished and the build completes successfully and the artifact directory contains the published website, the Release Manager takes over and creates a website in an environment, the website files are copied to the environment and the website started. All good so far.

Now someone starts the server and it fails because the database has not been migrated. How do we do that? The EF Tools no longer exist as that is back on the dev box and not on the server, in fact we can't even run dotnet.exe because the core sdk has not been deployed onto that environment. so even if we had the tools, we can't execute them.

In EF 6.x it was easy cause we could just copy migrate.exe as part of the artifacts, and run that on the server after the files were copied. As I undertstand it, the EF Tools are now a DLL (ef.dll) that has to be run by dotnet.exe. Does this mean that all web servers now need Core SDK to perform migrations?

Allann avatar Dec 05 '16 02:12 Allann