com.googlecode.flyway.core.migration.sql
Class SqlMigration

java.lang.Object
  extended by com.googlecode.flyway.core.migration.Migration
      extended by com.googlecode.flyway.core.migration.sql.SqlMigration
All Implemented Interfaces:
java.lang.Comparable<Migration>

public class SqlMigration
extends Migration

Database migration based on a sql file.


Field Summary
 
Fields inherited from class com.googlecode.flyway.core.migration.Migration
checksum, description, schemaVersion, script
 
Constructor Summary
SqlMigration(org.springframework.core.io.Resource sqlScriptResource, PlaceholderReplacer placeholderReplacer, java.lang.String encoding, java.lang.String versionString, java.lang.String scriptName)
          Creates a new sql script migration based on this sql script.
 
Method Summary
 java.lang.String getLocation()
          retrieves the location of the migration
 MigrationType getMigrationType()
           
 void migrate(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, DbSupport dbSupport)
          Performs the migration.
 
Methods inherited from class com.googlecode.flyway.core.migration.Migration
compareTo, equals, getChecksum, getDescription, getScript, getVersion, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SqlMigration

public SqlMigration(org.springframework.core.io.Resource sqlScriptResource,
                    PlaceholderReplacer placeholderReplacer,
                    java.lang.String encoding,
                    java.lang.String versionString,
                    java.lang.String scriptName)
Creates a new sql script migration based on this sql script.

Parameters:
sqlScriptResource - The resource containing the sql script.
placeholderReplacer - The placeholder replacer to apply to sql migration scripts.
encoding - The encoding of this Sql migration.
versionString - The migration name in standard Flyway format '__, e.g. 1_2__Description
scriptName - The filename of this sql script, including the relative path from the root of baseDir.
Method Detail

getLocation

public java.lang.String getLocation()
Description copied from class: Migration
retrieves the location of the migration

Specified by:
getLocation in class Migration
Returns:
source of this migration

migrate

public void migrate(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate,
                    DbSupport dbSupport)
Description copied from class: Migration
Performs the migration.

Specified by:
migrate in class Migration
Parameters:
jdbcTemplate - To execute the migration statements.
dbSupport - The support for database-specific extensions.

getMigrationType

public MigrationType getMigrationType()
Specified by:
getMigrationType in class Migration
Returns:
The type of migration (INIT, SQL or JAVA)


Copyright © 2011. All Rights Reserved.