Package org.minijax.liquibase
Class LiquibaseHelper
- java.lang.Object
-
- org.minijax.liquibase.LiquibaseHelper
-
public class LiquibaseHelper extends 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(Map<String,String> props)Creates a new helper.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FilegenerateMigrations()FilegetMasterChangeLogFile()FilegetResourcesDir()voidmigrate()Helper utility to perform a Liquibase database migration.
-
-
-
Method Detail
-
getResourcesDir
public File getResourcesDir()
-
getMasterChangeLogFile
public File getMasterChangeLogFile()
-
migrate
public void migrate() throws liquibase.exception.LiquibaseException, SQLExceptionHelper utility to perform a Liquibase database migration.- Throws:
liquibase.exception.LiquibaseExceptionSQLException- See Also:
Liquibase.update(String)
-
generateMigrations
public File generateMigrations() throws IOException, liquibase.exception.LiquibaseException, SQLException
- Throws:
IOExceptionliquibase.exception.LiquibaseExceptionSQLException
-
-