public class AddForeignKeyConstraintChange extends AbstractChange
LiquibaseSerializable.SerializationType
NODENAME_COLUMN
EMPTY_CHANGE
GENERIC_CHANGELOG_EXTENSION_NAMESPACE, GENERIC_SNAPSHOT_EXTENSION_NAMESPACE, STANDARD_CHANGELOG_NAMESPACE, STANDARD_SNAPSHOT_NAMESPACE
PRIORITY_DEFAULT, PRIORITY_NOT_APPLICABLE, PRIORITY_SPECIALIZED
Constructor and Description |
---|
AddForeignKeyConstraintChange() |
Modifier and Type | Method and Description |
---|---|
ChangeStatus |
checkStatus(Database database)
Validate that this change executed successfully against the given database.
|
protected Change[] |
createInverses()
Create inverse changes that can roll back this change.
|
protected String[] |
createSupportedDatabasesMetaData(String parameterName,
DatabaseChangeProperty changePropertyAnnotation)
Create the
ChangeParameterMetaData "supportedDatabase" value. |
SqlStatement[] |
generateStatements(Database database)
Generates the
SqlStatement objects required to run the change for the given database. |
String |
getBaseColumnNames() |
String |
getBaseTableCatalogName() |
String |
getBaseTableName() |
String |
getBaseTableSchemaName() |
String |
getConfirmationMessage()
Confirmation message to be displayed after the change is executed.
|
String |
getConstraintName() |
Boolean |
getDeferrable() |
Boolean |
getDeleteCascade()
Deprecated.
Use
getOnDelete() .
This always returns null so it doesn't impact checksums when settings onDelete vs. deleteCascade |
Boolean |
getInitiallyDeferred() |
String |
getOnDelete() |
String |
getOnUpdate() |
String |
getReferencedColumnNames() |
String |
getReferencedTableCatalogName() |
String |
getReferencedTableName() |
String |
getReferencedTableSchemaName() |
Boolean |
getReferencesUniqueColumn()
Deprecated.
No longer supported in 3.0
|
String |
getSerializedObjectNamespace() |
Boolean |
getValidate()
the VALIDATE keyword defines whether a foreign key constraint on a column in a table
should be checked if it refers to a valid row or not.
|
void |
setBaseColumnNames(String baseColumnNames) |
void |
setBaseTableCatalogName(String baseTableCatalogName) |
void |
setBaseTableName(String baseTableName) |
void |
setBaseTableSchemaName(String baseTableSchemaName) |
void |
setConstraintName(String constraintName) |
void |
setDeferrable(Boolean deferrable) |
void |
setDeleteCascade(Boolean deleteCascade) |
void |
setInitiallyDeferred(Boolean initiallyDeferred) |
void |
setOnDelete(ForeignKeyConstraintType rule) |
void |
setOnDelete(String onDelete) |
void |
setOnUpdate(ForeignKeyConstraintType rule) |
void |
setOnUpdate(String rule) |
void |
setReferencedColumnNames(String referencedColumnNames) |
void |
setReferencedTableCatalogName(String referencedTableCatalogName) |
void |
setReferencedTableName(String referencedTableName) |
void |
setReferencedTableSchemaName(String referencedTableSchemaName) |
void |
setReferencesUniqueColumn(Boolean referencesUniqueColumn) |
void |
setValidate(Boolean shouldValidate) |
createChangeMetaData, createChangeParameterMetadata, createDescriptionMetaData, createEmptyColumnConfig, createExampleValueMetaData, createMustEqualExistingMetaData, createRequiredDatabasesMetaData, createSerializationTypeMetaData, createSinceMetaData, customLoadLogic, finishInitialization, generateCheckSum, generateRollbackStatements, generateRollbackStatementsVolatile, generateStatementsVolatile, getAffectedDatabaseObjects, getChangeSet, getDescription, getResourceAccessor, getSerializableFieldNamespace, getSerializableFields, getSerializableFieldType, getSerializableFieldValue, getSerializedObjectName, isInvalidProperty, load, serialize, serializeValue, setChangeSet, setResourceAccessor, supports, supportsRollback, toString, validate, warn
clone, describe, equals, get, get, get, getAttributes, getFieldValue, getObjectMetaData, getValuePath, has, hashCode, set
finalize, getClass, notify, notifyAll, wait, wait, wait
clone, describe, get, get, getAttributes, getObjectMetaData, getValuePath, has, set
protected String[] createSupportedDatabasesMetaData(String parameterName, DatabaseChangeProperty changePropertyAnnotation)
AbstractChange
ChangeParameterMetaData
"supportedDatabase" value.
Uses the value on the DatabaseChangeProperty annotation or returns an array containing the string "COMPUTE"
as a default. "COMPUTE" will cause ChangeParameterMetaData to attempt to determine the required databases
based on the generated StatementscreateSupportedDatabasesMetaData
in class AbstractChange
public String getBaseTableCatalogName()
public void setBaseTableCatalogName(String baseTableCatalogName)
public String getBaseTableSchemaName()
public void setBaseTableSchemaName(String baseTableSchemaName)
public String getBaseTableName()
public void setBaseTableName(String baseTableName)
public String getBaseColumnNames()
public void setBaseColumnNames(String baseColumnNames)
public String getReferencedTableCatalogName()
public void setReferencedTableCatalogName(String referencedTableCatalogName)
public String getReferencedTableSchemaName()
public void setReferencedTableSchemaName(String referencedTableSchemaName)
public String getReferencedTableName()
public void setReferencedTableName(String referencedTableName)
public String getReferencedColumnNames()
public void setReferencedColumnNames(String referencedColumnNames)
public String getConstraintName()
public void setConstraintName(String constraintName)
public Boolean getDeferrable()
public void setDeferrable(Boolean deferrable)
public Boolean getInitiallyDeferred()
public Boolean getValidate()
public void setValidate(Boolean shouldValidate)
shouldValidate
- - if shouldValidate is set to FALSE then the constraint will be created
with the 'ENABLE NOVALIDATE' mode. This means the constraint would be created, but that no
check will be done to ensure old data has valid foreign keys - only new data would be checked
to see if it complies with the constraint logic. The default state for foreign keys is to
have 'ENABLE VALIDATE' set.public void setInitiallyDeferred(Boolean initiallyDeferred)
public Boolean getDeleteCascade()
getOnDelete()
.
This always returns null so it doesn't impact checksums when settings onDelete vs. deleteCascadepublic void setDeleteCascade(Boolean deleteCascade)
public void setOnUpdate(String rule)
public String getOnUpdate()
public void setOnDelete(String onDelete)
public String getOnDelete()
public void setOnDelete(ForeignKeyConstraintType rule)
public void setOnUpdate(ForeignKeyConstraintType rule)
public SqlStatement[] generateStatements(Database database)
Change
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 Change.generateStatementsVolatile(liquibase.database.Database)
.protected Change[] createInverses()
AbstractChange
AbstractChange.generateRollbackStatements(liquibase.database.Database)
is overridden, this method may not be called.createInverses
in class AbstractChange
#supportsRollback
public ChangeStatus checkStatus(Database database)
Change
checkStatus
in interface Change
checkStatus
in class AbstractChange
public String getConfirmationMessage()
Change
@Deprecated public Boolean getReferencesUniqueColumn()
public void setReferencesUniqueColumn(Boolean referencesUniqueColumn)
public String getSerializedObjectNamespace()
getSerializedObjectNamespace
in interface LiquibaseSerializable
getSerializedObjectNamespace
in class AbstractChange
Copyright © 2023 Liquibase.org. All rights reserved.