Top Description Methods
liquibase.change.custom

public Interface CustomSqlChange

extends CustomChange
Imports
liquibase.database.Database, liquibase.exception.CustomChangeException, liquibase.statement.SqlStatement

Interface to implement when creating a custom change that generates SQL. When updating a database, implementing this interface is preferred over CustomTaskChange because the SQL can either be executed directly or saved to a text file for later use depending on the migration mode used. To allow the change to be rolled back, also implement the CustomSqlRollback interface. If your change requires sql-based logic and non-sql-based logic, it is best to create a changeset that contains a mix of CustomSqlChange and CustomTaskChange calls.
See Also
liquibase.change.custom.CustomSqlRollback, liquibase.change.custom.CustomTaskChange

Method Summary

Modifier and TypeMethod and Description
public SqlStatement[]

Returns:

an array of SqlStatements with the statements
generateStatements
(Database
the target liquibase.database.Database associated to this change's statements
database
)

Generates the SQL statements required to run the change

Inherited from liquibase.change.custom.CustomChange:
getConfirmationMessagesetFileOpenersetUpvalidate

Method Detail

generateStatementsback to summary
public SqlStatement[] generateStatements(Database database) throws CustomChangeException

Generates the SQL statements required to run the change

Parameters
database:Database

the target liquibase.database.Database associated to this change's statements

Returns:SqlStatement[]

an array of SqlStatements with the statements

Exceptions
CustomChangeException:
if an exception occurs while processing this change