Package rife.database.migrations
Class ReversibleDbMigration
java.lang.Object
rife.database.migrations.DbMigration
rife.database.migrations.ReversibleDbMigration
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voiddown()Declares the steps that reverse this migration.Methods inherited from class rife.database.migrations.DbMigration
add, add, add, alterTable, createIndex, createSequence, createTable, createView, datasource, delete, dropIndex, dropSequence, dropTable, dropView, insert, truncate, up, update
-
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
addmethods, typically undoing whatDbMigration.up()declares in the opposite order.- Since:
- 1.10
- See Also:
-