Class 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 Detail

      • Migration

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

      • migrate

        public abstract void migrate​(InstructionSet instructionSet)
        Migrates the database using the instructions.
        Parameters:
        instructionSet - the instructions
      • 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.