Last active
February 7, 2019 10:43
-
-
Save ZacharyCouchman/9febfa3b2a9afa175303dcb260f355d7 to your computer and use it in GitHub Desktop.
Create EF Core database migrations as a single idempotent SQL script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Paste this snippet in your .NET Core main .csproj file | |
// Change (or remove) the Condition statement if you want this to run on Debug builds (locally) as well | |
<Target Name="Create Migrations Script" AfterTargets="PostBuildEvent" Condition="'$(Configuration)' == 'Release'"> | |
<Exec Command="dotnet ef migrations script --configuration $(Configuration) --no-build --idempotent --output $(TargetDir)/migrations.sql"/> | |
</Target> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment