public interface Change extends LiquibaseSerializable, Plugin, ExtensibleObject
ChangeFactory
by ChangeLogParser
implementations.ChangeFactory
,
Database
LiquibaseSerializable.SerializationType
GENERIC_CHANGELOG_EXTENSION_NAMESPACE, GENERIC_SNAPSHOT_EXTENSION_NAMESPACE, STANDARD_CHANGELOG_NAMESPACE, STANDARD_SNAPSHOT_NAMESPACE
PRIORITY_DEFAULT, PRIORITY_NOT_APPLICABLE, PRIORITY_SPECIALIZED
Modifier and Type | Method and Description |
---|---|
ChangeStatus |
checkStatus(Database database)
Validate that this change executed successfully against the given database.
|
ChangeMetaData |
createChangeMetaData() |
void |
finishInitialization()
This method will be called by the changlelog parsing process after all of the
properties have been set to allow the task to do any additional initialization logic.
|
CheckSum |
generateCheckSum()
Calculates the checksum of this Change based on the current configuration.
|
SqlStatement[] |
generateRollbackStatements(Database database)
Generates the
SqlStatement objects that would roll back the change. |
boolean |
generateRollbackStatementsVolatile(Database database)
Returns true if this change reads data from the database or other sources that would change during the course of an update in the
generateRollbackStatements(Database) method. |
SqlStatement[] |
generateStatements(Database database)
Generates the
SqlStatement objects required to run the change for the given database. |
boolean |
generateStatementsVolatile(Database database)
Returns true if this change reads data from the database or other sources that would change during the course of an update in the
generateStatements(Database) method. |
Set<DatabaseObject> |
getAffectedDatabaseObjects(Database database)
Returns example
DatabaseObject instances describing the objects affected by this change. |
ChangeSet |
getChangeSet()
Returns the changeSet this Change is part of.
|
String |
getConfirmationMessage()
Confirmation message to be displayed after the change is executed.
|
String |
getDescription()
Short, scannable description for the DATABASECHANGELOG.DESCRIPTION column
|
void |
setChangeSet(ChangeSet changeSet)
Sets the changeSet this Change is a part of.
|
void |
setResourceAccessor(ResourceAccessor resourceAccessor)
Deprecated.
this is now set via
Scope |
boolean |
supports(Database database)
Return true if this Change object supports the passed database.
|
boolean |
supportsRollback(Database database)
Returns true if this can change be rolled back for the given database.
|
ValidationErrors |
validate(Database database)
Generate errors based on the configured Change instance.
|
Warnings |
warn(Database database)
Generates warnings based on the configured Change instance.
|
getSerializableFieldNamespace, getSerializableFields, getSerializableFieldType, getSerializableFieldValue, getSerializedObjectName, getSerializedObjectNamespace, load, serialize
clone, describe, get, get, getAttributes, getObjectMetaData, getValuePath, has, set
void finishInitialization() throws SetupException
SetupException
ChangeMetaData createChangeMetaData()
ChangeSet getChangeSet()
void setChangeSet(ChangeSet changeSet)
void setResourceAccessor(ResourceAccessor resourceAccessor)
Scope
ResourceAccessor
that should be used for any file and/or resource loading needed by this Change.
Called automatically by Liquibase during the changelog parsing process.boolean supports(Database database)
Warnings warn(Database database)
ValidationErrors validate(Database database)
Set<DatabaseObject> getAffectedDatabaseObjects(Database database)
DatabaseObject
instances describing the objects affected by this change.
This method is not called during the normal execution of a changelog, but but can be used as metadata for documentation or other integrations.CheckSum generateCheckSum()
String getConfirmationMessage()
SqlStatement[] generateStatements(Database database)
SqlStatement
objects required to run the change for the given database.
NOTE: This method may be called multiple times throughout the changelog execution process and may be called in documentation generation and other integration points as well.
If this method reads from the current database state or uses any other logic that will be affected by whether previous changeSets have ran or not, you must return true from generateStatementsVolatile(liquibase.database.Database)
.boolean generateStatementsVolatile(Database database)
generateStatements(Database)
method.
If true, this change cannot be used in an updateSql-style commands because Liquibase cannot know the SqlStatement
objects until all changeSets prior have been actually executed.boolean supportsRollback(Database database)
SqlStatement[] generateRollbackStatements(Database database) throws RollbackImpossibleException
SqlStatement
objects that would roll back the change.
NOTE: This method may be called multiple times throughout the changelog execution process and may be called in documentation generation and other integration points as well.
If this method reads from the current database state or uses any other logic that will be affected by whether previous changeSets have been rolled back or not, you must return true from generateRollbackStatementsVolatile(liquibase.database.Database)
.RollbackImpossibleException
- if rollback is not supported for this changeboolean generateRollbackStatementsVolatile(Database database)
generateRollbackStatements(Database)
method.
If true, this change cannot be used in an updateSql-style commands because Liquibase cannot know the SqlStatement
objects until all changeSets prior have been actually executed.ChangeStatus checkStatus(Database database)
String getDescription()
Copyright © 2022 Liquibase.org. All rights reserved.