Class MigrationInfo

java.lang.Object
com.codename1.migration.MigrationInfo

public final class MigrationInfo extends Object
One row of Migrator.info(): a migration this build carries, one the database recorded, or both.
  • Constructor Details

    • MigrationInfo

      public MigrationInfo(String version, String description, String type, String script, Integer checksum, MigrationState state, int installedRank, String installedOn, int executionTime)
      Creates a row. Built by the engine; an application reads these.
      Parameters:
      version - the version, or null for a repeatable migration
      description - the description
      type - SQL, JDBC (Java), legacy JAVA, or BASELINE
      script - the script or class name
      checksum - the checksum, or null where there is none
      state - where the migration stands
      installedRank - the order it was applied in, or -1 if it was not
      installedOn - when it was applied, as the database prints it, or null
      executionTime - how long it took in milliseconds, or -1
  • Method Details

    • getVersion

      public String getVersion()
      The version.
      Returns:
      the version, or null for a repeatable migration
    • getDescription

      public String getDescription()
      The description.
      Returns:
      the description from the file name or the registration
    • getType

      public String getType()
      The kind of migration.
      Returns:
      SQL, JDBC (Java), legacy JAVA, or BASELINE
    • getScript

      public String getScript()
      The script file or migration class.
      Returns:
      the name recorded in the history
    • getChecksum

      public Integer getChecksum()
      The checksum of the script.
      Returns:
      the checksum, or null for a Java migration and a baseline
    • getState

      public MigrationState getState()
      Where the migration stands.
      Returns:
      the state
    • getInstalledRank

      public int getInstalledRank()
      The order the migration was applied in.
      Returns:
      the rank, or -1 if it has not been applied
    • getInstalledOn

      public String getInstalledOn()
      When the migration was applied.
      Returns:
      the timestamp as the database prints it, or null if it has not been applied
    • getExecutionTime

      public int getExecutionTime()
      How long the migration took.
      Returns:
      milliseconds, or -1 if it has not been applied
    • toString

      public String toString()
      One line per migration, for a log.
      Overrides:
      toString in class Object
      Returns:
      version, description, type and state