|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.googlecode.flyway.core.Flyway
public class Flyway
This is the centre point of Flyway, and for most users, the only class they will ever have to deal with.
It is THE public API from which all important Flyway functions such as clean, validate and migrate can be called.
| Constructor Summary | |
|---|---|
Flyway()
|
|
| Method Summary | |
|---|---|
void |
clean()
Drops all objects (tables, views, procedures, triggers, ...) in the current schema. |
void |
configure(java.util.Properties properties)
Configures Flyway with these properties. |
java.util.List<MetaDataTableRow> |
history()
Returns the history (all applied migrations) of the database. |
void |
init(SchemaVersion initialVersion)
Deprecated. Use init(SchemaVersion initialVersion, String description). Will be removed before 1.0. |
void |
init(SchemaVersion initialVersion,
java.lang.String description)
Creates and initializes the Flyway metadata table. |
int |
migrate()
Starts the database migration. |
void |
setBaseDir(java.lang.String baseDir)
|
void |
setBasePackage(java.lang.String basePackage)
|
void |
setDataSource(javax.sql.DataSource dataSource)
|
void |
setEncoding(java.lang.String encoding)
|
void |
setPlaceholderPrefix(java.lang.String placeholderPrefix)
|
void |
setPlaceholders(java.util.Map<java.lang.String,java.lang.String> placeholders)
|
void |
setPlaceholderSuffix(java.lang.String placeholderSuffix)
|
void |
setSchemaMetaDataTable(java.lang.String table)
Deprecated. |
void |
setSqlMigrationPrefix(java.lang.String sqlMigrationPrefix)
|
void |
setSqlMigrationSuffix(java.lang.String sqlMigrationSuffix)
|
void |
setTable(java.lang.String table)
|
void |
setValidationErrorMode(ValidationErrorMode validationErrorMode)
|
void |
setValidationMode(ValidationMode validationMode)
|
MetaDataTableRow |
status()
Returns the status (current version) of the database. |
void |
validate()
Validate applied migration with classpath migrations to detect accidental changes. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Flyway()
| Method Detail |
|---|
public void setValidationMode(ValidationMode validationMode)
validationMode - The ValidationMode for checksum validationpublic void setValidationErrorMode(ValidationErrorMode validationErrorMode)
validationErrorMode - The error mode for validationpublic void setBasePackage(java.lang.String basePackage)
basePackage - The base package where the migrations are located. (default:
db.migration)public void setBaseDir(java.lang.String baseDir)
baseDir - The base directory on the classpath where the Sql migrations
are located. (default: sql/location)public void setEncoding(java.lang.String encoding)
encoding - The encoding of Sql migrations.
(default: UTF-8)@Deprecated public void setSchemaMetaDataTable(java.lang.String table)
table - The name of the schema metadata table that will be used by flyway. (default: schema_version)public void setTable(java.lang.String table)
table - The name of the schema metadata table that will be used by flyway. (default: schema_version)public void setPlaceholders(java.util.Map<java.lang.String,java.lang.String> placeholders)
placeholders - A map of public void setPlaceholderPrefix(java.lang.String placeholderPrefix)
placeholderPrefix - The prefix of every placeholder. (default: ${ )public void setPlaceholderSuffix(java.lang.String placeholderSuffix)
placeholderSuffix - The suffix of every placeholder. (default: } )public void setSqlMigrationPrefix(java.lang.String sqlMigrationPrefix)
sqlMigrationPrefix - The file name prefix for sql migrations (default: V)public void setSqlMigrationSuffix(java.lang.String sqlMigrationSuffix)
sqlMigrationSuffix - The file name suffix for sql migrations (default: .sql)public void setDataSource(javax.sql.DataSource dataSource)
dataSource - The datasource to use. Must have the necessary privileges to
execute ddl.
public int migrate()
throws java.lang.Exception
java.lang.Exception - Thrown when the migration failed.public void clean()
public void validate()
public MetaDataTableRow status()
null if no migration has been applied yet.public java.util.List<MetaDataTableRow> history()
@Deprecated public void init(SchemaVersion initialVersion)
initialVersion - (Optional) The initial version to put in the metadata table. Only migrations with a version number
higher than this one will be considered for this database.
public void init(SchemaVersion initialVersion,
java.lang.String description)
initialVersion - (Optional) The initial version to put in the metadata table. Only migrations with a version number
higher than this one will be considered for this database.description - (Optional) The description of the initial version.public void configure(java.util.Properties properties)
properties - Properties used for configuration.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||