Entity Framework Core-Update Database or Migrations Without Source Code and Visual Studio
Entity Framework Core-Update Database or Migrations Without Source Code and Visual Studio
We might want to apply some migrations or update the production database to the last ?
=> The idea is to generate script and send to our customers to run the script in productions =>
use :script-migration from Visual Studio source code
If we want to generate script for the whole database , just run script-migration
If we want to generate script for a specific migration, provide the migration parameter -from or -
to , see more in official document
If we not provide the -to then the Script-Migration will generate -from "migration" to the last
If we don't want to generate scipt, it's able to write some code to let EF automatically run
Migration
myDbContext.Database.Migrate();
...
}
...
}