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 Details

    • ChangeSetPersistedPrecondition

      public ChangeSetPersistedPrecondition()
  • Method Details

    • setId

      public void setId(String id)
    • setAuthor

      public void setAuthor(String author)
    • setFile

      public void setFile(String file)
    • check

      public void check(liquibase.database.Database database) throws liquibase.exception.CustomPreconditionFailedException, liquibase.exception.CustomPreconditionErrorException
      Specified by:
      check in interface liquibase.precondition.CustomPrecondition
      Throws:
      liquibase.exception.CustomPreconditionFailedException
      liquibase.exception.CustomPreconditionErrorException