Page tree

Versions Compared

Key

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

...

Administration

Database Setup

Note: The current schema is out of date; updated instructions will be available soon.

Download the schema from the CI server

...

Database initialization can be done through the flyway-maven-plugin provided that you have a PostgresQL database which you can connect to and create/drop tables for. The flyway plugin will create load the first version of the schema and baseline the database at 1.0 so that all migrations can be applied. This requires the chronopolis-core repository to be cloned so that the flyway plugin can be run.

To run the flyway plugin, cd into the ingest-rest directory and use flyway:baseline and provide configuration for the flyway.user, flyway.password, and flyway.url configuration parameters. Once the database is baselined, the ingest server can be started and will apply all migrations.


Code Block
languagesql
titleExample PostgresSQL Setup
collapsetrue
psql (8.4.20)
Type "help" for help.
postgres=# CREATE USER chron WITH PASSWORD 'secret-password';
CREATE ROLE
postgres=# CREATE DATABASE ingest;
CREATE DATABASE
postgres=# GRANT ALL PRIVILEGES ON DATABASE ingest to chron;
GRANT
postgres=# \c ingest;
psql (8.4.20)
You are now connected to database "ingest".
ingest=# SET ROLE chron;
SET
ingest=> \i /tmp/schema_pg.sql[chronopolis-core] $ cd ingest-rest
[chronopolis-core/ingest-rest] $ ../mvnw -Dflyway.user=postgres -Dflyway.password=mysecretpassword -Dflyway.url=jdbc:postgresql://172.17.0.2/ingest flyway:baseline

Preparing the DB for Schema Migrations

...