Package liquibase.change
Interface Change
- All Superinterfaces:
Cloneable,ExtensibleObject,LiquibaseSerializable,Plugin
- All Known Implementing Classes:
AbstractChange,AbstractModifyDataChange,AbstractSQLChange,AbstractTableChange,AddAutoIncrementChange,AddColumnChange,AddDefaultValueChange,AddForeignKeyConstraintChange,AddLookupTableChange,AddNotNullConstraintChange,AddPrimaryKeyChange,AddUniqueConstraintChange,AlterSequenceChange,CreateIndexChange,CreateProcedureChange,CreateSequenceChange,CreateTableChange,CreateViewChange,CustomChangeWrapper,DeleteDataChange,DropAllForeignKeyConstraintsChange,DropColumnChange,DropDefaultValueChange,DropForeignKeyConstraintChange,DropIndexChange,DropNotNullConstraintChange,DropPrimaryKeyChange,DropProcedureChange,DropSequenceChange,DropTableChange,DropUniqueConstraintChange,DropViewChange,EmptyChange,ExecuteShellCommandChange,InsertDataChange,LoadDataChange,LoadUpdateDataChange,MergeColumnChange,ModifyDataTypeChange,OutputChange,RawSQLChange,RenameColumnChange,RenameSequenceChange,RenameTableChange,RenameViewChange,SetColumnRemarksChange,SetTableRemarksChange,SQLFileChange,StopChange,TagDatabaseChange,UpdateDataChange
Interface all changes (refactorings) implement.
Instances of these objects are normally created via the ChangeFactory by ChangeLogParser implementations.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface liquibase.serializer.LiquibaseSerializable
LiquibaseSerializable.SerializationType -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Change[]Represent an empty array ofChangestatic final StringFields inherited from interface liquibase.serializer.LiquibaseSerializable
GENERIC_CHANGELOG_EXTENSION_NAMESPACE, GENERIC_SNAPSHOT_EXTENSION_NAMESPACE, STANDARD_CHANGELOG_NAMESPACE, STANDARD_SNAPSHOT_NAMESPACEFields inherited from interface liquibase.plugin.Plugin
PRIORITY_DATABASE, PRIORITY_DEFAULT, PRIORITY_NOT_APPLICABLE, PRIORITY_SPECIALIZED -
Method Summary
Modifier and TypeMethodDescriptioncheckStatus(Database database) Validate that this change executed successfully against the given database.voidThis method will be called by the changelog parsing process after all of the properties have been set to allow the task to do any additional initialization logic.Calculates the checksum of this Change based on the current configuration.generateRollbackStatements(Database database) Generates theSqlStatementobjects that would roll back the change.booleangenerateRollbackStatementsVolatile(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 thegenerateRollbackStatements(Database)method.generateStatements(Database database) Generates theSqlStatementobjects required to run the change for the given database.booleangenerateStatementsVolatile(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 thegenerateStatements(Database)method.getAffectedDatabaseObjects(Database database) Returns exampleDatabaseObjectinstances describing the objects affected by this change.Returns the changeSet this Change is part of.Confirmation message to be displayed after the change is executed.Short, scannable description for the DATABASECHANGELOG.DESCRIPTION columnvoidmodify(ChangeVisitor changeVisitor) voidsetChangeSet(ChangeSet changeSet) Sets the changeSet this Change is a part of.voidsetResourceAccessor(ResourceAccessor resourceAccessor) Deprecated.default booleanDefault implementation always returns true.booleanReturn true if this Change object supports the passed database.booleansupportsRollback(Database database) Returns true if this can change be rolled back for the given database.Generate errors based on the configured Change instance.Generates warnings based on the configured Change instance.Methods inherited from interface liquibase.ExtensibleObject
clone, describe, get, get, getAttributes, getObjectMetaData, getValuePath, has, setMethods inherited from interface liquibase.serializer.LiquibaseSerializable
getSerializableFieldNamespace, getSerializableFields, getSerializableFieldType, getSerializableFieldValue, getSerializedObjectName, getSerializedObjectNamespace, load, serialize
-
Field Details
-
EMPTY_CHANGE
Represent an empty array ofChange -
SHOULD_EXECUTE
- See Also:
-
-
Method Details
-
finishInitialization
This method will be called by the changelog parsing process after all of the properties have been set to allow the task to do any additional initialization logic.- Throws:
SetupException
-
createChangeMetaData
ChangeMetaData createChangeMetaData() -
getChangeSet
ChangeSet getChangeSet()Returns the changeSet this Change is part of. Will return null if this instance was not constructed as part of a changelog file. -
setChangeSet
Sets the changeSet this Change is a part of. Called automatically by Liquibase during the changelog parsing process. -
setResourceAccessor
Deprecated.this is now set viaScopeSets theResourceAccessorthat should be used for any file and/or resource loading needed by this Change. Called automatically by Liquibase during the changelog parsing process. -
supports
Return true if this Change object supports the passed database. Used by the ChangeLog parsing process. -
warn
Generates warnings based on the configured Change instance. Warnings do not stop changelog execution, but are passed along to the end user for reference. Can return null or an empty Warnings object when there are no warnings. -
validate
Generate errors based on the configured Change instance. If there are any validation errors, changelog processing will normally not occur. Can return null or empty ValidationErrors object when there are no errors. -
getAffectedDatabaseObjects
Returns exampleDatabaseObjectinstances describing the objects affected by this change. This method is not called during the normal execution of a changelog, but can be used as metadata for documentation or other integrations. -
generateCheckSum
CheckSum generateCheckSum()Calculates the checksum of this Change based on the current configuration. The checksum should take into account all settings that would impact what actually happens to the database and NOT include any settings that do not impact the actual execution of the change. -
getConfirmationMessage
String getConfirmationMessage()Confirmation message to be displayed after the change is executed. Should include relevant configuration settings to make it as helpful as possible. This method may be called outside the changelog execution process, such as in documentation generation. -
generateStatements
Generates theSqlStatementobjects 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 fromgenerateStatementsVolatile(liquibase.database.Database). -
generateStatementsVolatile
Returns true if this change reads data from the database or other sources that would change during the course of an update in thegenerateStatements(Database)method. If true, this change cannot be used in an updateSql-style commands because Liquibase cannot know theSqlStatementobjects until all changeSets prior have been actually executed. -
supportsRollback
Returns true if this can change be rolled back for the given database. -
generateRollbackStatements
Generates theSqlStatementobjects 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 fromgenerateRollbackStatementsVolatile(liquibase.database.Database).- Throws:
RollbackImpossibleException- if rollback is not supported for this change
-
generateRollbackStatementsVolatile
Returns true if this change reads data from the database or other sources that would change during the course of an update in thegenerateRollbackStatements(Database)method. If true, this change cannot be used in an updateSql-style commands because Liquibase cannot know theSqlStatementobjects until all changeSets prior have been actually executed. -
checkStatus
Validate that this change executed successfully against the given database. This will check that the update completed at a high level plus check details of the change. For example, a change to add a column will check that the column exists plus data type, default values, etc. -
getDescription
String getDescription()Short, scannable description for the DATABASECHANGELOG.DESCRIPTION column -
modify
- Parameters:
changeVisitor-- Throws:
ParsedNodeException- if there is an error processing ChangeVisitor
-
shouldRunOnOs
default boolean shouldRunOnOs()Default implementation always returns true. Any implementation can override. Currently only ExecuteShellCommandChange overrides- Returns:
- boolean
-
Scope