public class LiquibaseFacade extends Object
Usage:
@ImportService
private DatabaseService database;
...
database.registerMigration(new DatabaseMigration() {
@Override
public void execute(DataSource dataSource) {
new LiquibaseFacade(datasource).migrate("/migrations/migration01.xml");
}
}
| Constructor and Description |
|---|
LiquibaseFacade(DataSource dataSource) |
| Modifier and Type | Method and Description |
|---|---|
void |
dropAll() |
void |
migrate(String changelog)
Migrate using given migration.
|
void |
migrate(String changelog,
String contexts)
Migrate using given migration.
|
void |
migrate(String changelog,
String contexts,
Map<String,Object> changelogParameters)
Migrate using given migration.
|
void |
rollbackLastUpdate(String changelog)
Rollbacks last update.
|
void |
rollbackLastUpdate(String changelog,
String contexts)
Rollbacks last update.
|
void |
rollbackLastUpdate(String changelog,
String contexts,
Map<String,Object> changelogParameters)
Rollbacks given changelog to given tag.
|
@Inject public LiquibaseFacade(DataSource dataSource)
public void migrate(String changelog)
changelog - resource with the migrationpublic void migrate(String changelog, String contexts)
changelog - resource with the migrationcontexts - contexts, see Liquibase.update(String).public void migrate(String changelog, String contexts, Map<String,Object> changelogParameters)
changelog - resource with the migrationcontexts - contexts, see Liquibase.update(String).changelogParameters - changelog parameters, can be nullpublic void rollbackLastUpdate(String changelog)
changelog - resource with the migrationpublic void rollbackLastUpdate(String changelog, String contexts)
changelog - resource with the migrationcontexts - contexts, see Liquibase.update(String).public void rollbackLastUpdate(String changelog, String contexts, Map<String,Object> changelogParameters)
changelog - resource with the migrationcontexts - contexts, see Liquibase.update(String).changelogParameters - changelogParameterspublic void dropAll()
Copyright © 2014 Atteo. All rights reserved.