@groovy.transform.CompileStatic @liquibase.change.DatabaseChange(name: grailsChange, description: Executes groovy code to apply a database change., priority: ChangeMetaData.PRIORITY_DEFAULT) class GroovyChange extends liquibase.change.AbstractChange
Custom Groovy-based change.
Modifiers | Name | Description |
---|---|---|
class |
GroovyChange.1 |
Fields inherited from class | Fields |
---|---|
class liquibase.change.AbstractChange |
EMPTY_CHANGE, SHOULD_EXECUTE, STANDARD_CHANGELOG_NAMESPACE, GENERIC_CHANGELOG_EXTENSION_NAMESPACE, STANDARD_SNAPSHOT_NAMESPACE, GENERIC_SNAPSHOT_EXTENSION_NAMESPACE, PRIORITY_NOT_APPLICABLE, PRIORITY_DEFAULT, PRIORITY_SPECIALIZED, PRIORITY_DATABASE |
Type | Name and description |
---|---|
java.util.List |
allStatements |
groovy.lang.Closure |
changeClosure |
boolean |
changeClosureCalled |
java.lang.String |
checksumString |
java.lang.String |
confirmationMessage |
org.springframework.context.ApplicationContext |
ctx |
java.lang.String |
dataSourceName |
liquibase.database.Database |
database |
groovy.lang.Closure |
initClosure |
boolean |
initClosureCalled |
groovy.lang.Closure |
rollbackClosure |
groovy.sql.Sql |
sql |
groovy.lang.Closure |
validateClosure |
boolean |
validateClosureCalled |
liquibase.exception.ValidationErrors |
validationErrors |
liquibase.exception.Warnings |
warnings |
Constructor and description |
---|
GroovyChange() |
Type Params | Return Type | Name and description |
---|---|---|
|
void |
confirm(java.lang.String message) Called by the change or rollback closure. |
|
void |
error(java.lang.String message) Called by the validate closure. |
|
void |
finishInitialization() |
|
liquibase.change.CheckSum |
generateCheckSum() |
|
liquibase.statement.SqlStatement[] |
generateRollbackStatements(liquibase.database.Database database) |
|
liquibase.statement.SqlStatement[] |
generateStatements(liquibase.database.Database database) |
|
grails.core.GrailsApplication |
getApplication() Called from the change or rollback closure. |
|
grails.config.Config |
getConfig() Called from the change or rollback closure. |
|
java.lang.String |
getConfirmationMessage() |
|
java.sql.Connection |
getConnection() Called from the change or rollback closure. |
|
liquibase.database.DatabaseConnection |
getDatabaseConnection() Called from the change or rollback closure. |
|
groovy.sql.Sql |
getSql() Called from the change or rollback closure. |
|
void |
load(liquibase.parser.core.ParsedNode parsedNode, liquibase.resource.ResourceAccessor resourceAccessor) |
|
protected boolean |
shouldRun()
|
|
void |
sqlStatement(liquibase.statement.SqlStatement statement) Called by the change or rollback closure. |
|
void |
sqlStatements(java.util.List statements) Called by the change or rollback closure. |
|
boolean |
supportsRollback(liquibase.database.Database database) |
|
liquibase.exception.ValidationErrors |
validate(liquibase.database.Database database) |
|
liquibase.exception.Warnings |
warn(liquibase.database.Database database) |
|
void |
warn(java.lang.String warning) Called by the validate closure. |
|
protected void |
withNewTransaction(groovy.lang.Closure callable) Executes the grailsChange>change block within the context of a new transaction |
Methods inherited from class | Name |
---|---|
class liquibase.change.AbstractChange |
liquibase.change.AbstractChange#supports(liquibase.database.Database), liquibase.change.AbstractChange#getResourceAccessor(), liquibase.change.AbstractChange#modify(liquibase.change.visitor.ChangeVisitor), liquibase.change.AbstractChange#generateRollbackStatements(liquibase.database.Database), liquibase.change.AbstractChange#finishInitialization(), liquibase.change.AbstractChange#generateRollbackStatementsVolatile(liquibase.database.Database), liquibase.change.AbstractChange#generateCheckSum(), liquibase.change.AbstractChange#supportsRollback(liquibase.database.Database), liquibase.change.AbstractChange#getSerializableFieldValue(java.lang.String), liquibase.change.AbstractChange#getSerializableFieldType(java.lang.String), liquibase.change.AbstractChange#getSerializedObjectNamespace(), liquibase.change.AbstractChange#getSerializableFieldNamespace(java.lang.String), liquibase.change.AbstractChange#generateStatementsVolatile(liquibase.database.Database), liquibase.change.AbstractChange#setResourceAccessor(liquibase.resource.ResourceAccessor), liquibase.change.AbstractChange#setChangeSet(liquibase.changelog.ChangeSet), liquibase.change.AbstractChange#createChangeMetaData(), liquibase.change.AbstractChange#checkStatus(liquibase.database.Database), liquibase.change.AbstractChange#shouldExecuteChange(liquibase.database.Database), liquibase.change.AbstractChange#getExcludedFieldFilters(liquibase.ChecksumVersion), liquibase.change.AbstractChange#getAffectedDatabaseObjects(liquibase.database.Database), liquibase.change.AbstractChange#getSerializedObjectName(), liquibase.change.AbstractChange#getChangeSet(), liquibase.change.AbstractChange#getSerializableFields(), liquibase.change.AbstractChange#equals(java.lang.Object), liquibase.change.AbstractChange#toString(), liquibase.change.AbstractChange#hashCode(), liquibase.change.AbstractChange#load(liquibase.parser.core.ParsedNode, liquibase.resource.ResourceAccessor), liquibase.change.AbstractChange#validate(liquibase.database.Database), liquibase.change.AbstractChange#warn(liquibase.database.Database), liquibase.change.AbstractChange#getDescription(), liquibase.change.AbstractChange#serialize(), liquibase.change.AbstractChange#getObjectMetaData(), liquibase.change.AbstractChange#getValuePath(java.lang.String, java.lang.Class), liquibase.change.AbstractChange#get(java.lang.String, java.lang.Class), liquibase.change.AbstractChange#get(java.lang.String, java.lang.Object), liquibase.change.AbstractChange#clone(), liquibase.change.AbstractChange#set(java.lang.String, java.lang.Object), liquibase.change.AbstractChange#getAttributes(), liquibase.change.AbstractChange#has(java.lang.String), liquibase.change.AbstractChange#describe(), liquibase.change.AbstractChange#wait(long, int), liquibase.change.AbstractChange#wait(), liquibase.change.AbstractChange#wait(long), liquibase.change.AbstractChange#getClass(), liquibase.change.AbstractChange#notify(), liquibase.change.AbstractChange#notifyAll(), liquibase.change.AbstractChange#generateStatements(liquibase.database.Database), liquibase.change.AbstractChange#getConfirmationMessage() |
Called by the change or rollback closure. Overrides the confirmation message.
message
- the confirmation messageCalled by the validate closure. Adds a validation error.
message
- the error messageCalled from the change or rollback closure. Shortcut for the current application.
Called from the change or rollback closure. Shortcut for the current config.
Called from the change or rollback closure. Shortcut to get the real database connection.
null
if the database isn't set yetCalled from the change or rollback closure. Shortcut to get the (wrapper) database connection.
null
if the database isn't set yet Called from the change or rollback closure. Creates a Sql
instance from the current connection.
Called by the change or rollback closure. Adds a statement to be executed.
statement
- the statementCalled by the change or rollback closure. Adds multiple statements to be executed.
statement
- the statementCalled by the validate closure. Adds a warning message.
warning
- the warning messageExecutes the grailsChange>change block within the context of a new transaction
callable
- The changeClosure to callGroovy Documentation