1.4.6.3 Load SatDB database schema

To initialize the newly create database with all the required object definitions (schema) the installed migrate tool will be used. This tool needs the schema definition files (*.sql) which are installed by the satnms4-satdbpackage to /home/satnms/satdb/. Usually this package automatically runs the database migration steps, but if this fails you will find below how to run the step manually.

You can check the current database version with:

migrate -database 'postgres://satnms:satnms@localhost:5432/satnms?sslmode=disable' -path satdb version

Remark: If the database is already initialized it will only run the migration for the new version(s). E.g. if already database version 2 is installed and there are migration files for version 3 and 4 it will upgrade the database to version 4.

example output

satnms@satnms7-dev:~$ migrate -database 'postgres://satnms:satnms@localhost:5432/satnms?sslmode=disable' -path satdb up
1/u init_satdb (81.381471ms)
2/u init_satdb (96.040331ms)
satnms@satnms7-dev:~$