Exemplo n.º 1
0
        public static IReadOnlyList <MigrationOperation> GetDowngradeOperations([NotNull] this Migration migration)
        {
            Check.NotNull(migration, "migration");

            var migrationBuilder = new MigrationBuilder();

            migration.Down(migrationBuilder);

            return(migrationBuilder.Operations);
        }
 private static void Undo(Stack <Migration> history, Exception e)
 {
     WriteLine(e.Message);
     WriteLine("Rollbacking changes...");
     while (history.Count > 0)
     {
         Migration rollback = history.Pop();
         WriteLine($"\n\tRunning {rollback.GetType().Name} ...");
         rollback.Down();
     }
 }