Esempio n. 1
0
        public static bool AllMigrationsApplied(this TerkwazDbContext context)
        {
            var applied = context.GetService <IHistoryRepository>()
                          .GetAppliedMigrations()
                          .Select(m => m.MigrationId);

            var total = context.GetService <IMigrationsAssembly>()
                        .Migrations
                        .Select(m => m.Key);

            return(total.Except(applied).Any());
        }
Esempio n. 2
0
 public static void EnsureMigrated(this TerkwazDbContext context)
 {
     context.Database.Migrate();
 }