com.googlecode.flyway.core.metadatatable
Class MetaDataTableRow

java.lang.Object
  extended by com.googlecode.flyway.core.metadatatable.MetaDataTableRow
All Implemented Interfaces:
java.lang.Comparable<MetaDataTableRow>

public class MetaDataTableRow
extends java.lang.Object
implements java.lang.Comparable<MetaDataTableRow>

A row in the schema metadata table containing information about a migration that has already been applied to a db.


Constructor Summary
MetaDataTableRow(Migration migration)
          Initializes a new metadatatable row with this migration.
MetaDataTableRow(SchemaVersion schemaVersion, java.lang.String description, MigrationType migrationType, java.lang.String script, java.lang.Integer checksum, java.util.Date installedOn, java.lang.Integer executionTime, MigrationState state)
          Creates a new MetaDataTableRow.
 
Method Summary
 void assertNotFailed()
          Asserts that this migration has not failed.
 int compareTo(MetaDataTableRow o)
           
 java.lang.Integer getChecksum()
           
 java.lang.String getDescription()
           
 java.lang.Integer getExecutionTime()
           
 java.util.Date getInstalledOn()
           
 MigrationType getMigrationType()
           
 java.lang.String getScript()
           
 MigrationState getState()
           
 SchemaVersion getVersion()
           
 void update(java.lang.Integer executionTime, MigrationState state)
          Updates this MetaDataTableRow with this execution time and this migration state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetaDataTableRow

public MetaDataTableRow(SchemaVersion schemaVersion,
                        java.lang.String description,
                        MigrationType migrationType,
                        java.lang.String script,
                        java.lang.Integer checksum,
                        java.util.Date installedOn,
                        java.lang.Integer executionTime,
                        MigrationState state)
Creates a new MetaDataTableRow. This constructor is here to support the rowmapper.

Parameters:
schemaVersion - The version of this migration.
description - The description for the migration history.
migrationType - The type of the migration (INIT, SQL or JAVA).
script - The script name for the migration history.
checksum - The checksum of the migration.
installedOn - The timestamp when this migration was applied to the database. (Automatically set by the database)
executionTime - The time (in ms) it took to execute.
state - The state of this migration.

MetaDataTableRow

public MetaDataTableRow(Migration migration)
Initializes a new metadatatable row with this migration.

Parameters:
migration - The migration that was or is being applied.
Method Detail

update

public void update(java.lang.Integer executionTime,
                   MigrationState state)
Updates this MetaDataTableRow with this execution time and this migration state.

Parameters:
executionTime - The time (in ms) it took to execute.
state - The state of this migration.

getMigrationType

public MigrationType getMigrationType()
Returns:
The type of the migration (INIT, SQL or JAVA).

getChecksum

public java.lang.Integer getChecksum()
Returns:
The checksum of the migration.

getVersion

public SchemaVersion getVersion()
Returns:
The schema version after the migration is complete.

getDescription

public java.lang.String getDescription()
Returns:
The description for the migration history.

getState

public MigrationState getState()
Returns:
The state of this migration.

getInstalledOn

public java.util.Date getInstalledOn()
Returns:
The timestamp when this migration was applied to the database. (Automatically set by the database)

getExecutionTime

public java.lang.Integer getExecutionTime()
Returns:
The time (in ms) it took to execute.

getScript

public java.lang.String getScript()
Returns:
The script name for the migration history.

assertNotFailed

public void assertNotFailed()
Asserts that this migration has not failed.

Throws:
java.lang.IllegalStateException - Thrown when this migration has failed.

compareTo

public int compareTo(MetaDataTableRow o)
Specified by:
compareTo in interface java.lang.Comparable<MetaDataTableRow>


Copyright © 2010. All Rights Reserved.