Package org.minijax.liquibase
Class LiquibaseHelper
java.lang.Object
org.minijax.liquibase.LiquibaseHelper
public class LiquibaseHelper
extends java.lang.Object
The LiquibaseHelper class provides helpers to migrate a database and generate new migrations.
It is a thin layer that wraps JPA and Liquibase.
By default, migrations are added to src/main/resources/changelog.xml.
The recommended workflow is to (1) generate a migration, (2) manually inspect the migration,
and (3) run the migration if everything looks ok.
-
Constructor Summary
Constructors Constructor Description LiquibaseHelper(java.util.Map<java.lang.String,java.lang.String> props)Creates a new helper. -
Method Summary
Modifier and Type Method Description java.io.FilegenerateMigrations()java.io.FilegetMasterChangeLogFile()java.io.FilegetResourcesDir()voidmigrate()Helper utility to perform a Liquibase database migration.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
LiquibaseHelper
public LiquibaseHelper(java.util.Map<java.lang.String,java.lang.String> props)Creates a new helper.- Parameters:
props-
-
-
Method Details
-
getResourcesDir
public java.io.File getResourcesDir() -
getMasterChangeLogFile
public java.io.File getMasterChangeLogFile() -
migrate
public void migrate() throws liquibase.exception.LiquibaseException, java.sql.SQLExceptionHelper utility to perform a Liquibase database migration.- Throws:
liquibase.exception.LiquibaseExceptionjava.sql.SQLException- See Also:
Liquibase.update(String)
-
generateMigrations
public java.io.File generateMigrations() throws java.io.IOException, liquibase.exception.LiquibaseException, java.sql.SQLException- Throws:
java.io.IOExceptionliquibase.exception.LiquibaseExceptionjava.sql.SQLException
-