liquibase.change |
|
Java Source File Name | Type | Comment |
AbstractChange.java | Class | Standard superclass for Changes to implement. |
AbstractChangeTest.java | Class | |
AbstractSQLChange.java | Class | A common parent for all SQL related changes regardless of where the sql was sourced from. |
AbstractSQLChangeTest.java | Class | |
AddAutoIncrementChange.java | Class | Makes an existing column into an auto-increment column. |
AddAutoIncrementChangeTest.java | Class | |
AddColumnChange.java | Class | Adds a column to an existing table. |
AddColumnChangeTest.java | Class | |
AddDefaultValueChange.java | Class | Sets a new default value to an existing column. |
AddDefaultValueChangeTest.java | Class | |
AddForeignKeyConstraintChange.java | Class | Adds a foreign key constraint to an existing column. |
AddForeignKeyConstraintChangeTest.java | Class | |
AddLookupTableChange.java | Class | Extracts data from an existing column to create a lookup table. |
AddNotNullConstraintChange.java | Class | Adds a not-null constraint to an existing column. |
AddNotNullConstraintChangeTest.java | Class | |
AddPrimaryKeyChange.java | Class | Creates a primary key out of an existing column or set of columns. |
AddPrimaryKeyChangeTest.java | Class | |
AddUniqueConstraintChange.java | Class | Adds a unique constraint to an existing column. |
AddUniqueConstraintChangeTest.java | Class | |
AlterSequenceChange.java | Class | Modifies properties of an existing sequence. |
AlterSequenceChangeTest.java | Class | |
Change.java | Interface | Interface all changes (refactorings) implement.
How changes are constructed and run when reading changelogs:
- As the changelog handler gets to each element inside a changeSet, it passes the tag name to liquibase.change.ChangeFactory
which looks through all the registered changes until it finds one with matching specified tag name
- The ChangeFactory then constructs a new instance of the change
- For each attribute in the XML node, reflection is used to call a corresponding set* method on the change class
- The correct generateStatements(*) method is called for the current database
To implement a new change:
- Create a new class that implements Change (normally extend AbstractChange)
- Implement the abstract generateStatements(*) methods which return the correct SQL calls for each database
- Implement the createMessage() method to create a descriptive message for logs and dialogs
- Implement the createNode() method to generate an XML element based on the values in this change
- Add the new class to the liquibase.change.ChangeFactory
Implementing automatic rollback support
The easiest way to allow automatic rollback support is by overriding the createInverses() method.
If there are no corresponding inverse changes, you can override the generateRollbackStatements(*) and canRollBack() methods.
Notes for generated SQL:
Because migration and rollback scripts can be generated for execution at a different time, or against a different database,
changes you implement cannot directly reference data in the database. |
ChangeFactory.java | Class | Factory class for constructing the correct liquibase.change.Change implementation based on the tag name.
It is currently implemented by a static array of Change implementations, although that may change in
later revisions. |
ChangeFactoryTest.java | Class | |
ColumnConfig.java | Class | This class is the representation of the column tag in the XMl file
It has a reference to the Constraints object for getting information
about the columns constraints. |
ColumnConfigTest.java | Class | |
ConstraintsConfig.java | Class | This class is resposible for holding the information about all the
constraints imposed on the column. |
ConstraintsConfigTest.java | Class | |
CreateIndexChange.java | Class | Creates an index on an existing column. |
CreateIndexChangeTest.java | Class | |
CreateProcedureChange.java | Class | |
CreateProcedureChangeTest.java | Class | |
CreateSequenceChange.java | Class | Creates a new sequence. |
CreateSequenceChangeTest.java | Class | |
CreateTableChange.java | Class | Creates a new table. |
CreateTableChangeTest.java | Class | |
CreateViewChange.java | Class | Creats a new view. |
CreateViewChangeTest.java | Class | |
DeleteDataChange.java | Class | |
DropColumnChange.java | Class | Drops an existing column from a table. |
DropColumnChangeTest.java | Class | |
DropDefaultValueChange.java | Class | Removes the default value from an existing column. |
DropDefaultValueChangeTest.java | Class | |
DropForeignKeyConstraintChange.java | Class | Drops an existing foreign key constraint. |
DropForeignKeyConstraintChangeTest.java | Class | |
DropIndexChange.java | Class | Drops an existing index. |
DropIndexChangeTest.java | Class | |
DropNotNullConstraintChange.java | Class | Drops a not-null constraint from an existing column. |
DropNotNullConstraintChangeTest.java | Class | |
DropPrimaryKeyChange.java | Class | Removes an existing primary key. |
DropPrimaryKeyChangeTest.java | Class | |
DropSequenceChange.java | Class | Drops an existing sequence. |
DropSequenceChangeTest.java | Class | |
DropTableChange.java | Class | Drops an existing table. |
DropTableChangeTest.java | Class | |
DropUniqueConstraintChange.java | Class | Removes an existing unique constraint. |
DropUniqueConstraintChangeTest.java | Class | |
DropViewChange.java | Class | Drops an existing view. |
DropViewChangeTest.java | Class | |
ExecuteShellCommandChange.java | Class | Executes a given shell executable. |
InsertDataChange.java | Class | Inserts data into an existing table. |
InsertDataChangeTest.java | Class | |
MergeColumnChange.java | Class | Combines data from two existing columns into a new column and drops the original columns. |
ModifyColumnChange.java | Class | Modifies the data type of an existing column. |
ModifyColumnChangeTest.java | Class | |
RawSQLChange.java | Class | Allows execution of arbitrary SQL. |
RawSQLChangeTest.java | Class | |
RenameColumnChange.java | Class | Renames an existing column. |
RenameColumnChangeTest.java | Class | |
RenameTableChange.java | Class | Renames an existing table. |
RenameTableChangeTest.java | Class | |
RenameViewChange.java | Class | Renames an existing view. |
RenameViewChangeTest.java | Class | |
SQLFileChange.java | Class | Represents a Change for custom SQL stored in a File. |
SQLFileChangeTest.java | Class | Tests the SQL File with a simple text file. |
UpdateDataChange.java | Class | |