public class Liquibase extends Object
Modifier and Type | Field and Description |
---|---|
protected Database |
database |
static String |
ENABLE_CHANGELOG_PROP_ESCAPING |
static String |
SHOULD_RUN_SYSTEM_PROPERTY |
Constructor and Description |
---|
Liquibase(DatabaseChangeLog changeLog,
ResourceAccessor resourceAccessor,
Database database) |
Liquibase(String changeLogFile,
ResourceAccessor resourceAccessor,
Database database)
Creates a Liquibase instance.
|
Liquibase(String changeLogFile,
ResourceAccessor resourceAccessor,
DatabaseConnection conn)
Creates a Liquibase instance for a given DatabaseConnection.
|
Modifier and Type | Method and Description |
---|---|
CheckSum |
calculateCheckSum(String changeSetIdentifier) |
CheckSum |
calculateCheckSum(String filename,
String id,
String author) |
void |
changeLogSync(Contexts contexts) |
void |
changeLogSync(Contexts contexts,
Writer output) |
void |
changeLogSync(String contexts) |
void |
changeLogSync(String contexts,
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(Integer count,
Contexts contexts,
Writer output) |
void |
futureRollbackSQL(Integer count,
String contexts,
Writer output) |
void |
futureRollbackSQL(String contexts,
Writer output) |
void |
generateChangeLog(CatalogAndSchema catalogAndSchema,
DiffToChangeLog changeLogWriter,
PrintStream outputStream,
Class<? extends DatabaseObject>... snapshotTypes) |
void |
generateDocumentation(String outputDirectory) |
void |
generateDocumentation(String outputDirectory,
Contexts contexts) |
void |
generateDocumentation(String outputDirectory,
String contexts) |
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.
|
Collection<RanChangeSet> |
listUnexpectedChangeSets(Contexts contexts) |
Collection<RanChangeSet> |
listUnexpectedChangeSets(String contexts) |
List<ChangeSet> |
listUnrunChangeSets(Contexts contexts) |
List<ChangeSet> |
listUnrunChangeSets(String contexts) |
void |
markNextChangeSetRan(Contexts contexts) |
void |
markNextChangeSetRan(Contexts contexts,
Writer output) |
void |
markNextChangeSetRan(String contexts) |
void |
markNextChangeSetRan(String contexts,
Writer output) |
void |
reportLocks(PrintStream out) |
void |
reportStatus(boolean verbose,
Contexts contexts,
Writer out) |
void |
reportStatus(boolean verbose,
String contexts,
Writer out) |
void |
reportUnexpectedChangeSets(boolean verbose,
Contexts contexts,
Writer out) |
void |
reportUnexpectedChangeSets(boolean verbose,
String contexts,
Writer out) |
void |
rollback(Date dateToRollBackTo,
Contexts contexts) |
void |
rollback(Date dateToRollBackTo,
Contexts contexts,
Writer output) |
void |
rollback(Date dateToRollBackTo,
String contexts) |
void |
rollback(Date dateToRollBackTo,
String contexts,
Writer output) |
void |
rollback(int changesToRollback,
Contexts contexts) |
void |
rollback(int changesToRollback,
Contexts contexts,
Writer output) |
void |
rollback(int changesToRollback,
String contexts) |
void |
rollback(int changesToRollback,
String contexts,
Writer output) |
void |
rollback(String tagToRollBackTo,
Contexts contexts) |
void |
rollback(String tagToRollBackTo,
Contexts contexts,
Writer output) |
void |
rollback(String tagToRollBackTo,
String contexts) |
void |
rollback(String tagToRollBackTo,
String contexts,
Writer output) |
void |
setChangeExecListener(ChangeExecListener listener) |
void |
setChangeLogParameter(String key,
Object value) |
void |
setCurrentDateTimeFunction(String currentDateTimeFunction)
Deprecated.
Should call
Database.setCurrentDateTimeFunction(String) directly |
void |
setIgnoreClasspathPrefix(boolean ignoreClasspathPrefix) |
void |
tag(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,
Writer output) |
void |
update(int changesToApply,
Contexts contexts) |
void |
update(int changesToApply,
Contexts contexts,
Writer output) |
void |
update(int changesToApply,
String contexts) |
void |
update(int changesToApply,
String contexts,
Writer output) |
void |
update(String contexts)
Convience method for
update(Contexts) that constructs the Context object from the passed string. |
void |
update(String contexts,
Writer output) |
void |
updateTestingRollback(Contexts contexts) |
void |
updateTestingRollback(String contexts) |
void |
validate()
Checks changelogs for bad MD5Sums and preconditions before attempting a migration
|
public static final String SHOULD_RUN_SYSTEM_PROPERTY
public static final String ENABLE_CHANGELOG_PROP_ESCAPING
protected Database database
public Liquibase(String changeLogFile, ResourceAccessor resourceAccessor, DatabaseConnection conn) throws LiquibaseException
DatabaseFactory.findCorrectDatabaseImplementation(liquibase.database.DatabaseConnection)
public Liquibase(String changeLogFile, ResourceAccessor resourceAccessor, Database database) throws LiquibaseException
LiquibaseException
ResourceAccessor
public Liquibase(DatabaseChangeLog changeLog, ResourceAccessor resourceAccessor, Database database)
public String getChangeLogFile()
public Logger getLog()
public ChangeLogParameters getChangeLogParameters()
public Database getDatabase()
public ResourceAccessor getFileOpener()
getResourceAccessor()
public ResourceAccessor getResourceAccessor()
public void setCurrentDateTimeFunction(String currentDateTimeFunction)
Database.setCurrentDateTimeFunction(String)
directlypublic void update(String contexts) throws LiquibaseException
update(Contexts)
that constructs the Context object from the passed string.LiquibaseException
public 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.LiquibaseException
public DatabaseChangeLog getDatabaseChangeLog() throws LiquibaseException
LiquibaseException
protected UpdateVisitor createUpdateVisitor()
protected ChangeLogIterator getStandardChangelogIterator(Contexts contexts, DatabaseChangeLog changeLog) throws DatabaseException
DatabaseException
public void update(String contexts, Writer output) throws LiquibaseException
LiquibaseException
public void update(Contexts contexts, Writer output) throws LiquibaseException
LiquibaseException
public void update(int changesToApply, String contexts) throws LiquibaseException
LiquibaseException
public void update(int changesToApply, Contexts contexts) throws LiquibaseException
LiquibaseException
public void update(int changesToApply, String contexts, Writer output) throws LiquibaseException
LiquibaseException
public void update(int changesToApply, Contexts contexts, Writer output) throws LiquibaseException
LiquibaseException
public void rollback(int changesToRollback, String contexts, Writer output) throws LiquibaseException
LiquibaseException
public void rollback(int changesToRollback, Contexts contexts, Writer output) throws LiquibaseException
LiquibaseException
public void rollback(int changesToRollback, String contexts) throws LiquibaseException
LiquibaseException
public void rollback(int changesToRollback, Contexts contexts) throws LiquibaseException
LiquibaseException
public void rollback(String tagToRollBackTo, String contexts, Writer output) throws LiquibaseException
LiquibaseException
public void rollback(String tagToRollBackTo, Contexts contexts, Writer output) throws LiquibaseException
LiquibaseException
public void rollback(String tagToRollBackTo, String contexts) throws LiquibaseException
LiquibaseException
public void rollback(String tagToRollBackTo, Contexts contexts) throws LiquibaseException
LiquibaseException
public void rollback(Date dateToRollBackTo, String contexts, Writer output) throws LiquibaseException
LiquibaseException
public void rollback(Date dateToRollBackTo, Contexts contexts, Writer output) throws LiquibaseException
LiquibaseException
public void rollback(Date dateToRollBackTo, String contexts) throws LiquibaseException
LiquibaseException
public void rollback(Date dateToRollBackTo, Contexts contexts) throws LiquibaseException
LiquibaseException
public void changeLogSync(String contexts, Writer output) throws LiquibaseException
LiquibaseException
public void changeLogSync(Contexts contexts, Writer output) throws LiquibaseException
LiquibaseException
public void changeLogSync(String contexts) throws LiquibaseException
LiquibaseException
public void changeLogSync(Contexts contexts) throws LiquibaseException
LiquibaseException
public void markNextChangeSetRan(String contexts, Writer output) throws LiquibaseException
LiquibaseException
public void markNextChangeSetRan(Contexts contexts, Writer output) throws LiquibaseException
LiquibaseException
public void markNextChangeSetRan(String contexts) throws LiquibaseException
LiquibaseException
public void markNextChangeSetRan(Contexts contexts) throws LiquibaseException
LiquibaseException
public void futureRollbackSQL(String contexts, Writer output) throws LiquibaseException
LiquibaseException
public void futureRollbackSQL(Integer count, String contexts, Writer output) throws LiquibaseException
LiquibaseException
public void futureRollbackSQL(Integer count, Contexts contexts, Writer output) throws LiquibaseException
LiquibaseException
public final void dropAll() throws DatabaseException, LockException
DatabaseException
LockException
public final void dropAll(CatalogAndSchema... schemas) throws DatabaseException
DatabaseException
public void tag(String tagString) throws LiquibaseException
LiquibaseException
public void updateTestingRollback(String contexts) throws LiquibaseException
LiquibaseException
public void updateTestingRollback(Contexts contexts) throws LiquibaseException
LiquibaseException
public void checkLiquibaseTables(boolean updateExistingNullChecksums, DatabaseChangeLog databaseChangeLog, Contexts contexts) throws LiquibaseException
LiquibaseException
public boolean isSafeToRunUpdate() throws DatabaseException
DatabaseException
public DatabaseChangeLogLock[] listLocks() throws LiquibaseException
LiquibaseException
public void reportLocks(PrintStream out) throws LiquibaseException
LiquibaseException
public void forceReleaseLocks() throws LiquibaseException
LiquibaseException
public List<ChangeSet> listUnrunChangeSets(String contexts) throws LiquibaseException
LiquibaseException
public List<ChangeSet> listUnrunChangeSets(Contexts contexts) throws LiquibaseException
LiquibaseException
public void reportStatus(boolean verbose, String contexts, Writer out) throws LiquibaseException
LiquibaseException
public void reportStatus(boolean verbose, Contexts contexts, Writer out) throws LiquibaseException
LiquibaseException
public Collection<RanChangeSet> listUnexpectedChangeSets(String contexts) throws LiquibaseException
LiquibaseException
public Collection<RanChangeSet> listUnexpectedChangeSets(Contexts contexts) throws LiquibaseException
LiquibaseException
public void reportUnexpectedChangeSets(boolean verbose, String contexts, Writer out) throws LiquibaseException
LiquibaseException
public void reportUnexpectedChangeSets(boolean verbose, Contexts contexts, Writer out) throws LiquibaseException
LiquibaseException
public void clearCheckSums() throws LiquibaseException
LiquibaseException
public final CheckSum calculateCheckSum(String changeSetIdentifier) throws LiquibaseException
LiquibaseException
public CheckSum calculateCheckSum(String filename, String id, String author) throws LiquibaseException
LiquibaseException
public void generateDocumentation(String outputDirectory) throws LiquibaseException
LiquibaseException
public void generateDocumentation(String outputDirectory, String contexts) throws LiquibaseException
LiquibaseException
public void generateDocumentation(String outputDirectory, Contexts contexts) throws LiquibaseException
LiquibaseException
public DiffResult diff(Database referenceDatabase, Database targetDatabase, CompareControl compareControl) throws LiquibaseException
LiquibaseException
public void validate() throws LiquibaseException
LiquibaseException
public void setChangeExecListener(ChangeExecListener listener)
public void setIgnoreClasspathPrefix(boolean ignoreClasspathPrefix)
public boolean isIgnoreClasspathPrefix()
public void generateChangeLog(CatalogAndSchema catalogAndSchema, DiffToChangeLog changeLogWriter, PrintStream outputStream, Class<? extends DatabaseObject>... snapshotTypes) throws DatabaseException, IOException, ParserConfigurationException
Copyright © 2014 Liquibase.org. All rights reserved.