com.google.code.flyway.core
Class MetaDataTable

java.lang.Object
  extended by com.google.code.flyway.core.MetaDataTable

public class MetaDataTable
extends java.lang.Object

Supports reading and writing to the metadata table.


Constructor Summary
MetaDataTable(org.springframework.transaction.support.TransactionTemplate transactionTemplate, org.springframework.jdbc.core.simple.SimpleJdbcTemplate jdbcTemplate, DbSupport dbSupport, java.lang.String tableName)
          Creates a new instance of the metadata table support.
 
Method Summary
 void create()
          Creates Flyway's metadata table.
 boolean exists()
          Checks whether Flyway's metadata table is already present in the database.
 Migration latestAppliedMigration()
           
 void migrationFinished(Migration migration)
          Marks this migration as succeeded.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetaDataTable

public MetaDataTable(org.springframework.transaction.support.TransactionTemplate transactionTemplate,
                     org.springframework.jdbc.core.simple.SimpleJdbcTemplate jdbcTemplate,
                     DbSupport dbSupport,
                     java.lang.String tableName)
Creates a new instance of the metadata table support.

Parameters:
transactionTemplate - The transaction template to use.
jdbcTemplate - SimpleJdbcTemplate with ddl manipulation access to the database.
dbSupport - Database-specific functionality.
tableName - The name of the schema metadata table used by flyway.
Method Detail

exists

public boolean exists()
               throws java.sql.SQLException
Checks whether Flyway's metadata table is already present in the database.

Returns:
true if the table exists, false if it doesn't.
Throws:
java.sql.SQLException - Thrown when the database metadata could not be read.

create

public void create()
Creates Flyway's metadata table.


migrationFinished

public void migrationFinished(Migration migration)
Marks this migration as succeeded.

Parameters:
migration - The migration that was run.

latestAppliedMigration

public Migration latestAppliedMigration()
Returns:
The latest migration applied on the schema.


Copyright © 2010. All Rights Reserved.