Class AppliedMigration

java.lang.Object
migratedb.v1.core.api.internal.schemahistory.AppliedMigration

public final class AppliedMigration extends Object
A migration applied to the database (maps to a row in the schema history table).

Its natural ordering is inconsistent with equals().

  • Constructor Details

    • AppliedMigration

      public AppliedMigration(int installedRank, @Nullable Version version, String description, MigrationType type, String script, @Nullable Checksum checksum, Timestamp installedOn, String installedBy, int executionTime, boolean success)
      Creates a new applied migration. Only called from the RowMapper.
      Parameters:
      installedRank - The order in which this migration was applied amongst all others. (For out of order detection)
      version - The target version of this migration.
      description - The description of the migration.
      type - The type of migration (INIT, SQL, ...)
      script - The name of the script to execute for this migration, relative to its classpath location.
      checksum - The checksum of the migration. (Optional)
      installedOn - The timestamp when this migration was installed.
      installedBy - The user that installed this migration.
      executionTime - The execution time (in millis) of this migration.
      success - Flag indicating whether the migration was successful or not.
  • Method Details

    • getInstalledRank

      public int getInstalledRank()
      Returns:
      The order in which this migration was applied amongst all others. (For out of order detection)
    • getVersion

      public @Nullable Version getVersion()
      Returns:
      The target version of this migration.
    • getDescription

      public String getDescription()
      Returns:
      The description of the migration.
    • getType

      public MigrationType getType()
      Returns:
      The type of migration (BASELINE, SQL, ...)
    • getScript

      public String getScript()
      Returns:
      The name of the script to execute for this migration, relative to its classpath location.
    • getChecksum

      public @Nullable Checksum getChecksum()
      Returns:
      The checksum of the migration. (Optional)
    • getInstalledOn

      public Instant getInstalledOn()
      Returns:
      The timestamp when this migration was installed.
    • getInstalledBy

      public String getInstalledBy()
      Returns:
      The user that installed this migration.
    • getExecutionTime

      public int getExecutionTime()
      Returns:
      The execution time (in millis) of this migration.
    • isSuccess

      public boolean isSuccess()
      Returns:
      Flag indicating whether the migration was successful or not.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isExecutionOfRepeatableMigration

      public boolean isExecutionOfRepeatableMigration()