Class Migration

java.lang.Object
org.dizitart.no2.migration.Migration

public abstract class Migration extends Object
Represents the database migration operation. A migration is a way to modify the structure of a database from one version to another. It contains a queue of MigrationSteps that need to be executed in order to migrate the database from the start version to the end version.
Since:
4.0
Author:
Anindya Chatterjee
  • Constructor Details

    • Migration

      public Migration(Integer fromVersion, Integer toVersion)
      Instantiates a new Migration.
      Parameters:
      fromVersion - the start version
      toVersion - the end version
  • Method Details

    • migrate

      public abstract void migrate(InstructionSet instructionSet)
      Migrates the database using the instructions.
      Parameters:
      instructionSet - the instructions
    • steps

      public Queue<MigrationStep> steps()
      Returns the queue of MigrationSteps to be executed for the migration.
      Returns:
      the queue
    • getFromVersion

      public Integer getFromVersion()
      Returns the version number from which the migration is being performed.
    • getToVersion

      public Integer getToVersion()
      Returns the version number to which the migration is being performed.