alterCompositeTypeAttributes
The alterCompositeTypeAttributes change type allows you to change the attributes associated with a composite type. You can add, alter, or drop a composite type attribute.
Run alterCompositeTypeAttributes
To run this Change Type, follow these steps:
Add the Change Type to your changeset, as shown in the examples on this page.
Specify any required attributes. Use the table on this page to see which ones your database requires.
Deploy your changeset by running the
update
command:liquibase update
Available attributes
Name | Type | Description | Requirement |
| String | Name of the catalog | Optional |
| String | Name of the schema that contains the composite type you want to alter | Required |
| String | Name of the type you want to alter | Optional |
Nested tags
Name | Type | Description | Requirement |
String | Add an attribute to a composite type. This is an object that can be passed | You must choose to use | |
String | Change an object associated with a composite type. This is an object that can be passed | You must choose to use | |
dropAttribute | String | Remove an attribute associated with a composite type. This is an object that can be passed | You must choose to use |
alterCompositeTypeAttributes examples
databaseChangeLog:
- changeSet:
id: 1
author: itTest
changes:
- createCompositeType:
typeName: myType
typeAttributes:
- typeAttribute:
name: attr0
type: int
- typeAttribute:
name: attr1
type: int
- typeAttribute:
name: attr2
type: int
- changeSet:
id: 2
author: itTest
changes:
- alterCompositeTypeAttributes:
typeName: myType
addAttributes:
- addAttribute:
name: attr3
type: text
collation: en_US
onCreate: CASCADE
alterAttributes:
- alterAttribute:
name: attr0
newType: text
collation: en_US
onUpdate: RESTRICT
dropAttributes:
- dropAttribute:
name: attr1
ifExists: 'true'
onDelete: CASCADE
rollback:
- empty