Class ReversibleDbMigration

java.lang.Object
rife.database.migrations.DbMigration
rife.database.migrations.ReversibleDbMigration

public abstract class ReversibleDbMigration extends DbMigration
Provides a single declarative database migration that can be rolled back.

Extending this class instead of DbMigration is what makes a migration reversible. The reverse steps are declared in down() with the same add methods that DbMigration.up() uses, so that DbMigrations can execute them when the migration is rolled back.

Since:
1.10
See Also:
  • Constructor Details

    • ReversibleDbMigration

      public ReversibleDbMigration()
  • Method Details

    • down

      public abstract void down()
      Declares the steps that reverse this migration.

      This method will be called while the steps of a rollback are being collected; you declare each of them by calling one of the add methods, typically undoing what DbMigration.up() declares in the opposite order.

      Since:
      1.10
      See Also: