Versions Compared

Key

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

...

The change-log will then be updated running the following yaml files in order, based on the changelog-master.yaml file within the cps-ri->src->main->resources->changelog→db.changes directory. 

Note

Anytime a new change-log YAML is added, it will need to be included in this file for the changes to be applied within CPS


Code Block
languageyml
titlechangelog-master.yaml
collapsetrue
databaseChangeLog:
  - include:
      file: changelog/db/changes/01-createCPSTables.yaml
  - include:
      file: changelog/db/changes/02-loadData-dataspace.yaml
  - include:
      file: changelog/db/changes/03-loadData-schema-set.yaml
  - include:
      file: changelog/db/changes/04-loadData-anchor.yaml
  - include:
      file: changelog/db/changes/05-loadData-fragment.yaml
  - include:
      file: changelog/db/changes/06-delete-not-required-fragment-index.yaml
  - include:
      file: changelog/db/changes/07-update-yang-resource-checksums.yaml
  - include:
      file: changelog/db/changes/08-update-yang-resources.yaml
  - include:
      file: changelog/db/changes/09-loadData-dmi-registry-schema-set.yaml
  - include:
      file: changelog/db/changes/10-loadData-dmi-registry-fragment.yaml
  - include:
      file: changelog/db/changes/11-add-column-to-yang-resources-table.yaml

...

To rename a column use the following syntax, specifying the table and the oldColumnName, along with the new Column Name.

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 above.


Code Block
languageyml
titleTest Table With Foreign Key Example
collapsetrue
  - changeSet:
      id: 1-39
      author: cps
      changes:
        - createTable:
            columns:
              - column:
                  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_fk

Add New Column

Insert Data

...