Package liquibase.changelog
Class MockChangeLogHistoryService
java.lang.Object
liquibase.changelog.MockChangeLogHistoryService
- All Implemented Interfaces:
ChangeLogHistoryService
,Plugin
-
Field Summary
Fields inherited from interface liquibase.plugin.Plugin
PRIORITY_DATABASE, PRIORITY_DEFAULT, PRIORITY_NOT_APPLICABLE, PRIORITY_SPECIALIZED
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
destroy()
void
int
int
getRanChangeSet
(ChangeSet changeSet) getRanChangeSets
(boolean a) This method was created to clear out MD5sum for upgrade purpose but after some refactoring the logic was moved to Update commands and it should have been removed as everywhere it is called only with boolean false, so for core it is the same as getRanChangeSets().getRanDate
(ChangeSet changeSet) Returns the date the given changeSet was run.getRunStatus
(ChangeSet changeSet) void
init()
Ensures the change log history container is correctly initialized for use.boolean
This method should return true if all checksums in dbcl table have the same version as {@link liquibase.ChecksumVersion#latest().getVersion()}.void
removeFromHistory
(ChangeSet changeSet) void
reset()
void
void
setDatabase
(Database database) void
setExecType
(ChangeSet changeSet, ChangeSet.ExecType execType) boolean
void
boolean
void
upgradeChecksums
(DatabaseChangeLog databaseChangeLog, Contexts contexts, LabelExpression labels) Updates null checksum valuesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface liquibase.changelog.ChangeLogHistoryService
replaceChecksum
-
Field Details
-
ranChangeSets
-
-
Constructor Details
-
MockChangeLogHistoryService
public MockChangeLogHistoryService()
-
-
Method Details
-
getPriority
public int getPriority()- Specified by:
getPriority
in interfaceChangeLogHistoryService
-
supports
- Specified by:
supports
in interfaceChangeLogHistoryService
-
setDatabase
- Specified by:
setDatabase
in interfaceChangeLogHistoryService
-
reset
public void reset()- Specified by:
reset
in interfaceChangeLogHistoryService
-
init
Description copied from interface:ChangeLogHistoryService
Ensures the change log history container is correctly initialized for use. This method may be called multiple times so it should check state as needed.- Specified by:
init
in interfaceChangeLogHistoryService
- Throws:
DatabaseException
-
upgradeChecksums
public void upgradeChecksums(DatabaseChangeLog databaseChangeLog, Contexts contexts, LabelExpression labels) throws DatabaseException Description copied from interface:ChangeLogHistoryService
Updates null checksum values- Specified by:
upgradeChecksums
in interfaceChangeLogHistoryService
- Throws:
DatabaseException
-
getRanChangeSets
- Specified by:
getRanChangeSets
in interfaceChangeLogHistoryService
- Throws:
DatabaseException
-
getRanChangeSets
Description copied from interface:ChangeLogHistoryService
This method was created to clear out MD5sum for upgrade purpose but after some refactoring the logic was moved to Update commands and it should have been removed as everywhere it is called only with boolean false, so for core it is the same as getRanChangeSets().- Specified by:
getRanChangeSets
in interfaceChangeLogHistoryService
- Throws:
DatabaseException
-
getRanChangeSet
public RanChangeSet getRanChangeSet(ChangeSet changeSet) throws DatabaseException, DatabaseHistoryException - Specified by:
getRanChangeSet
in interfaceChangeLogHistoryService
- Throws:
DatabaseException
DatabaseHistoryException
-
getRunStatus
public ChangeSet.RunStatus getRunStatus(ChangeSet changeSet) throws DatabaseException, DatabaseHistoryException - Specified by:
getRunStatus
in interfaceChangeLogHistoryService
- Throws:
DatabaseException
DatabaseHistoryException
-
getRanDate
Description copied from interface:ChangeLogHistoryService
Returns the date the given changeSet was run. Returns null if changeSet was not null.- Specified by:
getRanDate
in interfaceChangeLogHistoryService
- Throws:
DatabaseException
DatabaseHistoryException
-
setExecType
- Specified by:
setExecType
in interfaceChangeLogHistoryService
- Throws:
DatabaseException
-
removeFromHistory
- Specified by:
removeFromHistory
in interfaceChangeLogHistoryService
- Throws:
DatabaseException
-
getNextSequenceValue
- Specified by:
getNextSequenceValue
in interfaceChangeLogHistoryService
- Throws:
LiquibaseException
-
tag
- Specified by:
tag
in interfaceChangeLogHistoryService
- Throws:
DatabaseException
-
tagExists
- Specified by:
tagExists
in interfaceChangeLogHistoryService
- Throws:
DatabaseException
-
clearAllCheckSums
- Specified by:
clearAllCheckSums
in interfaceChangeLogHistoryService
- Throws:
LiquibaseException
-
destroy
- Specified by:
destroy
in interfaceChangeLogHistoryService
- Throws:
DatabaseException
-
getDeploymentId
- Specified by:
getDeploymentId
in interfaceChangeLogHistoryService
-
resetDeploymentId
public void resetDeploymentId()- Specified by:
resetDeploymentId
in interfaceChangeLogHistoryService
-
generateDeploymentId
public void generateDeploymentId()- Specified by:
generateDeploymentId
in interfaceChangeLogHistoryService
-
isDatabaseChecksumsCompatible
public boolean isDatabaseChecksumsCompatible()Description copied from interface:ChangeLogHistoryService
This method should return true if all checksums in dbcl table have the same version as {@link liquibase.ChecksumVersion#latest().getVersion()}. This method is used by Update command family in order to know if there are old checksum versions in the database that should be updated or if it can proceed with fast checksum update process. IF your implementation does not validate dbcl table then return false.- Specified by:
isDatabaseChecksumsCompatible
in interfaceChangeLogHistoryService
- Returns:
- false if we have checksums different from {@link liquibase.ChecksumVersion#latest().getVersion()} in the dbcl table.
-