Entity Framework, Automatic apply Migrations
I use Entity Framework code first and set AutomaticMigrationsEnabled true by this code : Database.SetInitializer(new MigrateDatabaseToLatestVersion<DbContext, MigrateDBConfiguration>()); ////////////////////////////////// public class MigrateDBConfiguration : System.Data.Entity.Migrations.DbMigrationsConfiguration<DbContext> { public MigrateDBConfiguration() { AutomaticMigrationsEnabled = true; AutomaticMigrationDataLossAllowed = true; } } In first run the project it work fine and create database and tables. after I change model and drop some field or add new fields and run Add-Migration,