数据库迁移

数据库迁移命令:

Enable-Migrations -ContextTypeName Domain.ApplicationDbContext
Add-Migration InitialCreate
Update-Database -Verbose
update-database -script
Update-Database -Script -SourceMigration

//自动迁移
AutomaticMigrationsEnabled = true;
Database.SetInitializer(new MigrateDatabaseToLatestVersion());

你可能感兴趣的:(数据库迁移)