Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note

There is currently no YAML file within CPS specifically for renaming table columns, this example is done under the presumption that a new file has been created for renaming columns as seen by the updated id from the examples seen aboveexample.


Code Block
languageyml
titleTest Table With Foreign Key ExampleRename Column within test table
collapsetrue
databaseChangeLog:
  - changeSet:
      id: 12-1-39
      author: cps
      changes:
        - createTablerenameColumn:
            columnsnewColumnName: renamed_column
            oldColumnName:  - column:_1
                  autoIncrement: true
                  constraints:
                    nullable: false
                    primaryKey: true
                    primaryKeyName: test_table__with_fk_pkey
                  name: test_table_with_fk_id
                  type: INTEGER
              - column:
                  constraints:
                    nullable: false
                  name: column_1
                  type: TEXT
              - column:
                  constraints:
                    nullable: false
                  name: test_table_pk
                  type: INTEGER
            tableName: test_table_with_fktableName: test_table

Add New Column

Insert Data

...