renameCompositeTypeAttribute
The renameCompositeTypeAttribute
Change Type allows you to change the name of an attribute inside a user-defined composite type. When you rename a composite type attribute, you update the type structure without changing the type's name or fields.
Run renameCompositeTypeAttribute
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 rename. | Optional |
| String | Name of the type that contains the attribute you want to rename. | Required |
| String | Name of the attribute that you no longer want to use. | Required |
| String | Name of the new attribute that you want to use. | Required |
| String | Set to | Optional |
renameCompositeTypeAttribute examples
databaseChangeLog:
- changeSet:
id: 1
author: itTest
changes:
- createCompositeType:
typeName: myType
typeAttributes:
- typeAttribute:
name: attr1
type: int
- typeAttribute:
name: attr2
type: text
collation: en_US
- typeAttribute:
name: Attr3
type: real
- typeAttribute:
name: ATTR4
type: line
- renameCompositeTypeAttribute:
typeName: myType
oldAttributeName: attr1
newAttributeName: att®1
onUpdate: CASCADE
- renameCompositeTypeAttribute:
typeName: myType
oldAttributeName: attr2
newAttributeName: attribute 2
onUpdate: CASCADE
- renameCompositeTypeAttribute:
typeName: myType
oldAttributeName: Attr3
newAttributeName: AtTrIbUtE3
onUpdate: CASCADE
- renameCompositeTypeAttribute:
typeName: myType
oldAttributeName: ATTR4
newAttributeName: attr & 4
onUpdate: CASCADE