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.

You make a migration reversible by extending this class instead of DbMigration. 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 when the steps of a rollback are collected. You declare each step by calling one of the add methods, typically undoing what DbMigration.up() declares in the opposite order.

      Since:
      1.10
      See Also: