I'm trying to make a CD setup which migrates my target database on release in TFS 2017 (update 3). My artifacts only contains my website assemblies, with DB context and controllers etc. If I update my database during build (and not during release) I can run
dotnet ef database update
and it works nicely, but this ofcourse does not work during release, as the source code is not available in the artifacts, and dotnet restore requires the .csproj file.
Anyone have suggestion of how to set up migrations during release? Do I need to include my source in the artifacts?
I'm using .net core 2.0 and ef core 2.0
If you run
dotnet ef database update with the
--verbose option, you'll see a call to
dotnet exec ef.dll. This is the command you can use directly on the binaries without needing the source code.