Versions Compared

Key

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

Table of Contents

Steps to test

...

Liquibase change log

1. Run a new postgres instance container on your local machine

...

8. Run "update" liquibase script to apply all pending changes set and bring your database to istanbul version (Run step 4 command) 9. Run "status" liquibase script to validate that your db is now up to date for istambul (Run step 3 command)

Steps to test Liquibase Rollback

9. In case the latest updates needs to be rolled back, the below options could be used:

...

See also DB Schema Changes (Liquibase Change Logs)

Steps to create checksum for yang-resource

...


1.  Build Build locally using

Code Block
/onap/cps/cps-application$ mvn clean install -Pcps-ncmp-docker -DskiptTests=true
then run 
/onap/cps/docker-compose$ VERSION=latest DB_USERNAME=cps DB_PASSWORD=cps docker-compose up -d


2. Run to create new dataspace (if needed)

Code Block
curl --location --request POST 'http://localhost:8883/cps/api/v1/dataspaces?dataspace-name=NSODemo' \
--header 'Authorization: Basic Y3BzdXNlcjpjcHNyMGNrcyE='


3. Run to insert a yang resource.

     NOTE: Remove all escape characters from file, check attached file for reference.

Code Block
curl --location --request POST 'http://localhost:8883/cps/api/v1/dataspaces/NSODemo/schema-sets' \
--header 'Authorization: Basic Y3BzdXNlcjpjcHNyMGNrcyE=' \
--form 'file=@"****path-to-yang-file****"' \                      // insert your yang file path here
--form 'schema-set-name="dmi-registry@2021-05-20.yang"'

View file
namedmi-registry.yang
height250

4. login to postgres and check the entry in table to verify checksum

Code Block
psql -h localhost -p 5432 -U cps -d cpsdb

select * from yang_resource where name like '%dmi%'; //replace dmi with your names


Note about rollback

See:

* https://docs.liquibase.com/concepts/bestpractices.html in "Always think about rollback" section
* https://docs.liquibase.com/workflows/liquibase-community/using-rollback.html