How to use Entity Framework 5 First First Migrations to create a full script database from the initial (empty) state until the last migration?
Blog Post The MSDN Blog suggests doing this, but seems to be creating an empty script:
Update-Database -Script -SourceMigration: $InitialDatabase
The API seems to have changed (or at least it doesn't work for me).
Running the following in the package manager console works as expected:
Update-Database -Script -SourceMigration:0
, , , . Entity Framework:
Visual Studio :
Enable-Migrations Add-Migration
, "Initial", . :
Update-Database Update-Database -Script -SourceMigration:0
( , ).
, , . .
# Powershell / Package manager console Script-Migration # Cli dotnet ef migrations script
-From -To, .
-From
-To
Script-Migration -From 20190101011200_Initial-Migration -To 20190101021200_Migration-2
https://docs.microsoft.com/en-us/ef/core/managing-schemas/migrations/#generate-sql-scripts
., . , 0 ( ).- , . .. , . , , , , , .
.
, . , 0 ( ).
0
- , . .
. , . , , , , , .