public class Liquibase
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected Database |
database |
static java.lang.String |
ENABLE_CHANGELOG_PROP_ESCAPING |
static java.lang.String |
SHOULD_RUN_SYSTEM_PROPERTY |
| Constructor and Description |
|---|
Liquibase(java.lang.String changeLogFile,
ResourceAccessor resourceAccessor,
Database database) |
Liquibase(java.lang.String changeLogFile,
ResourceAccessor resourceAccessor,
DatabaseConnection conn) |
| Modifier and Type | Method and Description |
|---|---|
CheckSum |
calculateCheckSum(java.lang.String changeSetIdentifier) |
CheckSum |
calculateCheckSum(java.lang.String filename,
java.lang.String id,
java.lang.String author) |
void |
changeLogSync(java.lang.String contexts) |
void |
changeLogSync(java.lang.String contexts,
java.io.Writer output) |
void |
checkDatabaseChangeLogTable(boolean updateExistingNullChecksums,
DatabaseChangeLog databaseChangeLog,
java.lang.String contexts) |
void |
clearCheckSums()
Sets checksums to null so they will be repopulated next run
|
protected UpdateVisitor |
createUpdateVisitor() |
DiffResult |
diff(Database referenceDatabase,
Database targetDatabase,
CompareControl compareControl) |
void |
dropAll()
Drops all database objects owned by the current user.
|
void |
dropAll(CatalogAndSchema... schemas)
Drops all database objects owned by the current user.
|
void |
forceReleaseLocks() |
void |
futureRollbackSQL(java.lang.Integer count,
java.lang.String contexts,
java.io.Writer output) |
void |
futureRollbackSQL(java.lang.String contexts,
java.io.Writer output) |
void |
generateDocumentation(java.lang.String outputDirectory) |
void |
generateDocumentation(java.lang.String outputDirectory,
java.lang.String contexts) |
ChangeLogParameters |
getChangeLogParameters() |
Database |
getDatabase() |
ResourceAccessor |
getFileOpener()
FileOpener to use for accessing changelog files.
|
protected ChangeLogIterator |
getStandardChangelogIterator(java.lang.String contexts,
DatabaseChangeLog changeLog) |
boolean |
isIgnoreClasspathPrefix() |
boolean |
isSafeToRunUpdate()
Returns true if it is "save" to migrate the database.
|
DatabaseChangeLogLock[] |
listLocks()
Display change log lock information.
|
java.util.Collection<RanChangeSet> |
listUnexpectedChangeSets(java.lang.String contexts) |
java.util.List<ChangeSet> |
listUnrunChangeSets(java.lang.String contexts) |
void |
markNextChangeSetRan(java.lang.String contexts) |
void |
markNextChangeSetRan(java.lang.String contexts,
java.io.Writer output) |
void |
reportLocks(java.io.PrintStream out) |
void |
reportStatus(boolean verbose,
java.lang.String contexts,
java.io.Writer out) |
void |
reportUnexpectedChangeSets(boolean verbose,
java.lang.String contexts,
java.io.Writer out) |
void |
rollback(java.util.Date dateToRollBackTo,
java.lang.String contexts) |
void |
rollback(java.util.Date dateToRollBackTo,
java.lang.String contexts,
java.io.Writer output) |
void |
rollback(int changesToRollback,
java.lang.String contexts) |
void |
rollback(int changesToRollback,
java.lang.String contexts,
java.io.Writer output) |
void |
rollback(java.lang.String tagToRollBackTo,
java.lang.String contexts) |
void |
rollback(java.lang.String tagToRollBackTo,
java.lang.String contexts,
java.io.Writer output) |
void |
setChangeExecListener(ChangeExecListener listener) |
void |
setChangeLogParameter(java.lang.String key,
java.lang.Object value) |
void |
setCurrentDateTimeFunction(java.lang.String currentDateTimeFunction)
Use this function to override the current date/time function used to insert dates into the database.
|
void |
setIgnoreClasspathPrefix(boolean ignoreClasspathPrefix) |
void |
tag(java.lang.String tagString)
'Tags' the database for future rollback
|
void |
update(int changesToApply,
java.lang.String contexts) |
void |
update(int changesToApply,
java.lang.String contexts,
java.io.Writer output) |
void |
update(java.lang.String contexts) |
void |
update(java.lang.String contexts,
java.io.Writer output) |
void |
updateTestingRollback(java.lang.String contexts) |
void |
validate()
Checks changelogs for bad MD5Sums and preconditions before attempting a migration
|
public static final java.lang.String SHOULD_RUN_SYSTEM_PROPERTY
public static final java.lang.String ENABLE_CHANGELOG_PROP_ESCAPING
protected Database database
public Liquibase(java.lang.String changeLogFile,
ResourceAccessor resourceAccessor,
DatabaseConnection conn)
throws LiquibaseException
LiquibaseExceptionpublic Liquibase(java.lang.String changeLogFile,
ResourceAccessor resourceAccessor,
Database database)
throws LiquibaseException
LiquibaseExceptionpublic ChangeLogParameters getChangeLogParameters()
public Database getDatabase()
public ResourceAccessor getFileOpener()
public void setCurrentDateTimeFunction(java.lang.String currentDateTimeFunction)
public void update(java.lang.String contexts)
throws LiquibaseException
LiquibaseExceptionprotected UpdateVisitor createUpdateVisitor()
protected ChangeLogIterator getStandardChangelogIterator(java.lang.String contexts, DatabaseChangeLog changeLog) throws DatabaseException
DatabaseExceptionpublic void update(java.lang.String contexts,
java.io.Writer output)
throws LiquibaseException
LiquibaseExceptionpublic void update(int changesToApply,
java.lang.String contexts)
throws LiquibaseException
LiquibaseExceptionpublic void update(int changesToApply,
java.lang.String contexts,
java.io.Writer output)
throws LiquibaseException
LiquibaseExceptionpublic void rollback(int changesToRollback,
java.lang.String contexts,
java.io.Writer output)
throws LiquibaseException
LiquibaseExceptionpublic void rollback(int changesToRollback,
java.lang.String contexts)
throws LiquibaseException
LiquibaseExceptionpublic void rollback(java.lang.String tagToRollBackTo,
java.lang.String contexts,
java.io.Writer output)
throws LiquibaseException
LiquibaseExceptionpublic void rollback(java.lang.String tagToRollBackTo,
java.lang.String contexts)
throws LiquibaseException
LiquibaseExceptionpublic void rollback(java.util.Date dateToRollBackTo,
java.lang.String contexts,
java.io.Writer output)
throws LiquibaseException
LiquibaseExceptionpublic void rollback(java.util.Date dateToRollBackTo,
java.lang.String contexts)
throws LiquibaseException
LiquibaseExceptionpublic void changeLogSync(java.lang.String contexts,
java.io.Writer output)
throws LiquibaseException
LiquibaseExceptionpublic void changeLogSync(java.lang.String contexts)
throws LiquibaseException
LiquibaseExceptionpublic void markNextChangeSetRan(java.lang.String contexts,
java.io.Writer output)
throws LiquibaseException
LiquibaseExceptionpublic void markNextChangeSetRan(java.lang.String contexts)
throws LiquibaseException
LiquibaseExceptionpublic void futureRollbackSQL(java.lang.String contexts,
java.io.Writer output)
throws LiquibaseException
LiquibaseExceptionpublic void futureRollbackSQL(java.lang.Integer count,
java.lang.String contexts,
java.io.Writer output)
throws LiquibaseException
LiquibaseExceptionpublic final void dropAll()
throws DatabaseException,
LockException
DatabaseExceptionLockExceptionpublic final void dropAll(CatalogAndSchema... schemas) throws DatabaseException
DatabaseExceptionpublic void tag(java.lang.String tagString)
throws LiquibaseException
LiquibaseExceptionpublic void updateTestingRollback(java.lang.String contexts)
throws LiquibaseException
LiquibaseExceptionpublic void checkDatabaseChangeLogTable(boolean updateExistingNullChecksums,
DatabaseChangeLog databaseChangeLog,
java.lang.String contexts)
throws LiquibaseException
LiquibaseExceptionpublic boolean isSafeToRunUpdate()
throws DatabaseException
DatabaseExceptionpublic DatabaseChangeLogLock[] listLocks() throws LiquibaseException
LiquibaseExceptionpublic void reportLocks(java.io.PrintStream out)
throws LiquibaseException
LiquibaseExceptionpublic void forceReleaseLocks()
throws LiquibaseException
LiquibaseExceptionpublic java.util.List<ChangeSet> listUnrunChangeSets(java.lang.String contexts) throws LiquibaseException
LiquibaseExceptionpublic void reportStatus(boolean verbose,
java.lang.String contexts,
java.io.Writer out)
throws LiquibaseException
LiquibaseExceptionpublic java.util.Collection<RanChangeSet> listUnexpectedChangeSets(java.lang.String contexts) throws LiquibaseException
LiquibaseExceptionpublic void reportUnexpectedChangeSets(boolean verbose,
java.lang.String contexts,
java.io.Writer out)
throws LiquibaseException
LiquibaseExceptionpublic void clearCheckSums()
throws LiquibaseException
LiquibaseExceptionpublic final CheckSum calculateCheckSum(java.lang.String changeSetIdentifier) throws LiquibaseException
LiquibaseExceptionpublic CheckSum calculateCheckSum(java.lang.String filename, java.lang.String id, java.lang.String author) throws LiquibaseException
LiquibaseExceptionpublic void generateDocumentation(java.lang.String outputDirectory)
throws LiquibaseException
LiquibaseExceptionpublic void generateDocumentation(java.lang.String outputDirectory,
java.lang.String contexts)
throws LiquibaseException
LiquibaseExceptionpublic DiffResult diff(Database referenceDatabase, Database targetDatabase, CompareControl compareControl) throws LiquibaseException
LiquibaseExceptionpublic void validate()
throws LiquibaseException
LiquibaseExceptionpublic void setChangeLogParameter(java.lang.String key,
java.lang.Object value)
public void setChangeExecListener(ChangeExecListener listener)
public void setIgnoreClasspathPrefix(boolean ignoreClasspathPrefix)
public boolean isIgnoreClasspathPrefix()