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(DatabaseChangeLog changeLog,
ResourceAccessor resourceAccessor,
Database database) |
Liquibase(java.lang.String changeLogFile,
ResourceAccessor resourceAccessor,
Database database)
Creates a Liquibase instance.
|
Liquibase(java.lang.String changeLogFile,
ResourceAccessor resourceAccessor,
DatabaseConnection conn)
Creates a Liquibase instance for a given DatabaseConnection.
|
| 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(Contexts contexts) |
void |
changeLogSync(Contexts contexts,
java.io.Writer output) |
void |
changeLogSync(java.lang.String contexts) |
void |
changeLogSync(java.lang.String contexts,
java.io.Writer output) |
void |
checkLiquibaseTables(boolean updateExistingNullChecksums,
DatabaseChangeLog databaseChangeLog,
Contexts 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,
Contexts contexts,
java.io.Writer output) |
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 |
generateChangeLog(CatalogAndSchema catalogAndSchema,
DiffToChangeLog changeLogWriter,
java.io.PrintStream outputStream,
java.lang.Class<? extends DatabaseObject>... snapshotTypes) |
void |
generateDocumentation(java.lang.String outputDirectory) |
void |
generateDocumentation(java.lang.String outputDirectory,
Contexts contexts) |
void |
generateDocumentation(java.lang.String outputDirectory,
java.lang.String contexts) |
java.lang.String |
getChangeLogFile()
Return the change log file used by this Liquibase instance.
|
ChangeLogParameters |
getChangeLogParameters()
Returns the ChangeLogParameters container used by this Liquibase instance.
|
Database |
getDatabase()
Returns the Database used by this Liquibase instance.
|
DatabaseChangeLog |
getDatabaseChangeLog() |
ResourceAccessor |
getFileOpener()
Deprecated.
use the newer-terminology version
getResourceAccessor() |
Logger |
getLog()
Return the log used by this Liquibase instance.
|
ResourceAccessor |
getResourceAccessor()
Return ResourceAccessor used by this Liquibase instance.
|
protected ChangeLogIterator |
getStandardChangelogIterator(Contexts 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(Contexts contexts) |
java.util.Collection<RanChangeSet> |
listUnexpectedChangeSets(java.lang.String contexts) |
java.util.List<ChangeSet> |
listUnrunChangeSets(Contexts contexts) |
java.util.List<ChangeSet> |
listUnrunChangeSets(java.lang.String contexts) |
void |
markNextChangeSetRan(Contexts contexts) |
void |
markNextChangeSetRan(Contexts contexts,
java.io.Writer output) |
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,
Contexts contexts,
java.io.Writer out) |
void |
reportStatus(boolean verbose,
java.lang.String contexts,
java.io.Writer out) |
void |
reportUnexpectedChangeSets(boolean verbose,
Contexts contexts,
java.io.Writer out) |
void |
reportUnexpectedChangeSets(boolean verbose,
java.lang.String contexts,
java.io.Writer out) |
void |
rollback(java.util.Date dateToRollBackTo,
Contexts contexts) |
void |
rollback(java.util.Date dateToRollBackTo,
Contexts contexts,
java.io.Writer output) |
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,
Contexts contexts) |
void |
rollback(int changesToRollback,
Contexts 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,
Contexts contexts) |
void |
rollback(java.lang.String tagToRollBackTo,
Contexts 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)
Deprecated.
Should call
Database.setCurrentDateTimeFunction(String) directly |
void |
setIgnoreClasspathPrefix(boolean ignoreClasspathPrefix) |
void |
tag(java.lang.String tagString)
'Tags' the database for future rollback
|
void |
update(Contexts contexts)
Executes Liquibase "update" logic which ensures that the configured
Database is up to dat according to the configured changelog file. |
void |
update(Contexts contexts,
java.io.Writer output) |
void |
update(int changesToApply,
Contexts contexts) |
void |
update(int changesToApply,
Contexts contexts,
java.io.Writer output) |
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)
Convience method for
update(Contexts) that constructs the Context object from the passed string. |
void |
update(java.lang.String contexts,
java.io.Writer output) |
void |
updateTestingRollback(Contexts contexts) |
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
DatabaseFactory.findCorrectDatabaseImplementation(liquibase.database.DatabaseConnection)public Liquibase(java.lang.String changeLogFile,
ResourceAccessor resourceAccessor,
Database database)
throws LiquibaseException
LiquibaseExceptionResourceAccessorpublic Liquibase(DatabaseChangeLog changeLog, ResourceAccessor resourceAccessor, Database database)
public java.lang.String getChangeLogFile()
public Logger getLog()
public ChangeLogParameters getChangeLogParameters()
public Database getDatabase()
public ResourceAccessor getFileOpener()
getResourceAccessor()public ResourceAccessor getResourceAccessor()
public void setCurrentDateTimeFunction(java.lang.String currentDateTimeFunction)
Database.setCurrentDateTimeFunction(String) directlypublic void update(java.lang.String contexts)
throws LiquibaseException
update(Contexts) that constructs the Context object from the passed string.LiquibaseExceptionpublic void update(Contexts contexts) throws LiquibaseException
Database is up to dat according to the configured changelog file.
To run in "no context mode", pass a null or empty context object.LiquibaseExceptionpublic DatabaseChangeLog getDatabaseChangeLog() throws LiquibaseException
LiquibaseExceptionprotected UpdateVisitor createUpdateVisitor()
protected ChangeLogIterator getStandardChangelogIterator(Contexts contexts, DatabaseChangeLog changeLog) throws DatabaseException
DatabaseExceptionpublic void update(java.lang.String contexts,
java.io.Writer output)
throws LiquibaseException
LiquibaseExceptionpublic void update(Contexts contexts, java.io.Writer output) throws LiquibaseException
LiquibaseExceptionpublic void update(int changesToApply,
java.lang.String contexts)
throws LiquibaseException
LiquibaseExceptionpublic void update(int changesToApply,
Contexts contexts)
throws LiquibaseException
LiquibaseExceptionpublic void update(int changesToApply,
java.lang.String contexts,
java.io.Writer output)
throws LiquibaseException
LiquibaseExceptionpublic void update(int changesToApply,
Contexts 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,
Contexts contexts,
java.io.Writer output)
throws LiquibaseException
LiquibaseExceptionpublic void rollback(int changesToRollback,
java.lang.String contexts)
throws LiquibaseException
LiquibaseExceptionpublic void rollback(int changesToRollback,
Contexts 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,
Contexts contexts,
java.io.Writer output)
throws LiquibaseException
LiquibaseExceptionpublic void rollback(java.lang.String tagToRollBackTo,
java.lang.String contexts)
throws LiquibaseException
LiquibaseExceptionpublic void rollback(java.lang.String tagToRollBackTo,
Contexts 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,
Contexts contexts,
java.io.Writer output)
throws LiquibaseException
LiquibaseExceptionpublic void rollback(java.util.Date dateToRollBackTo,
java.lang.String contexts)
throws LiquibaseException
LiquibaseExceptionpublic void rollback(java.util.Date dateToRollBackTo,
Contexts contexts)
throws LiquibaseException
LiquibaseExceptionpublic void changeLogSync(java.lang.String contexts,
java.io.Writer output)
throws LiquibaseException
LiquibaseExceptionpublic void changeLogSync(Contexts contexts, java.io.Writer output) throws LiquibaseException
LiquibaseExceptionpublic void changeLogSync(java.lang.String contexts)
throws LiquibaseException
LiquibaseExceptionpublic void changeLogSync(Contexts contexts) throws LiquibaseException
LiquibaseExceptionpublic void markNextChangeSetRan(java.lang.String contexts,
java.io.Writer output)
throws LiquibaseException
LiquibaseExceptionpublic void markNextChangeSetRan(Contexts contexts, java.io.Writer output) throws LiquibaseException
LiquibaseExceptionpublic void markNextChangeSetRan(java.lang.String contexts)
throws LiquibaseException
LiquibaseExceptionpublic void markNextChangeSetRan(Contexts 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 void futureRollbackSQL(java.lang.Integer count,
Contexts 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 updateTestingRollback(Contexts contexts) throws LiquibaseException
LiquibaseExceptionpublic void checkLiquibaseTables(boolean updateExistingNullChecksums,
DatabaseChangeLog databaseChangeLog,
Contexts 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 java.util.List<ChangeSet> listUnrunChangeSets(Contexts contexts) throws LiquibaseException
LiquibaseExceptionpublic void reportStatus(boolean verbose,
java.lang.String contexts,
java.io.Writer out)
throws LiquibaseException
LiquibaseExceptionpublic void reportStatus(boolean verbose,
Contexts contexts,
java.io.Writer out)
throws LiquibaseException
LiquibaseExceptionpublic java.util.Collection<RanChangeSet> listUnexpectedChangeSets(java.lang.String contexts) throws LiquibaseException
LiquibaseExceptionpublic java.util.Collection<RanChangeSet> listUnexpectedChangeSets(Contexts contexts) throws LiquibaseException
LiquibaseExceptionpublic void reportUnexpectedChangeSets(boolean verbose,
java.lang.String contexts,
java.io.Writer out)
throws LiquibaseException
LiquibaseExceptionpublic void reportUnexpectedChangeSets(boolean verbose,
Contexts 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 void generateDocumentation(java.lang.String outputDirectory,
Contexts 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()
public void generateChangeLog(CatalogAndSchema catalogAndSchema, DiffToChangeLog changeLogWriter, java.io.PrintStream outputStream, java.lang.Class<? extends DatabaseObject>... snapshotTypes) throws DatabaseException, java.io.IOException, javax.xml.parsers.ParserConfigurationException
DatabaseExceptionjava.io.IOExceptionjavax.xml.parsers.ParserConfigurationException