Class ChangeSetPersistedPrecondition
java.lang.Object
org.keycloak.connections.jpa.updater.liquibase.custom.ChangeSetPersistedPrecondition
- All Implemented Interfaces:
liquibase.precondition.CustomPrecondition
public class ChangeSetPersistedPrecondition
extends Object
implements liquibase.precondition.CustomPrecondition
Passes when the given changeset is recorded in the persisted changelog table (DATABASECHANGELOG).
Unlike changeSetExecuted, which reads Liquibase's in-memory history, this queries the table. When a script
is generated (migration-strategy=manual) Liquibase also adds changesets that are only written to the script to its
in-memory history, so changeSetExecuted cannot tell them apart from changesets that have really been applied
to the database. This precondition reflects what the database contains at the time the script is generated.
The table is resolved and escaped through the Database, so a changelog table in a schema that needs quoting
(for example keycloak-t) is handled.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ChangeSetPersistedPrecondition
public ChangeSetPersistedPrecondition()
-
-
Method Details
-
setId
-
setAuthor
-
setFile
-
check
public void check(liquibase.database.Database database) throws liquibase.exception.CustomPreconditionFailedException, liquibase.exception.CustomPreconditionErrorException - Specified by:
checkin interfaceliquibase.precondition.CustomPrecondition- Throws:
liquibase.exception.CustomPreconditionFailedExceptionliquibase.exception.CustomPreconditionErrorException
-