Versions Compared

Key

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

...

Code Block
languagebash
docker run --name postgres -p 5432:5432 -d -e POSTGRES_DB=cpsdb -e POSTGRES_USER=cps -e POSTGRES_PASSWORD=cps postgres:13.2-alpine

Adding New Tables


Applying Pending Changes

To apply any changes made to the changelog within CPS, run the following command from the cps-ri directory

Code Block
languagebash
mvn compile org.liquibase:liquibase-maven-plugin:4.3.1:update  -Dliquibase.url=jdbc:postgresql://localhost:5432/cpsdb  -Dliquibase.username=cps  -Dliquibase.password=cps  -Dliquibase.changeLogFile=src/main/resources/changelog/changelog-master.yaml

Change-Log Order

The change-log will then be updated running the following yaml files in order, based on the changelog-master.yaml file To add new tables to tables within CPS using the Liquibase change-log go to the 01-createCPSTables.yaml within the cps-ri->src->main->resources->changelog→db.changes directory. 

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

Adding New Tables

To add new tables to tables within CPS using the Liquibase change-log go to the 01-createCPSTables.yaml file.

Under the databaseChangeLog object each change-set is defined with a unique id (Similar to how an array is defined within YAML).

...

test table with fk model.


Rename Column

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

Add New Column

Insert Data

...

Adding New Yang Resource


Rollback

...


Potential Issues