diff options
author | 2021-04-20 08:22:56 -0400 | |
---|---|---|
committer | 2021-04-22 10:00:22 -0400 | |
commit | 05855d531b912698ee63b1fd9de4303baff83670 (patch) | |
tree | 0496540ac248dff37629cdcffde6215b3096a343 /README.md | |
parent | 472d2e8d8df431e46b0f0dead8448bff5e80ab0d (diff) |
Implement db schema with liquibase
Issue-ID: CPS-193
Signed-off-by: Bruno Sakoto <bruno.sakoto@bell.ca>
Change-Id: Ieabee4b86bbe7a42c05bb225499487cfcc9deb1d
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 25 |
1 files changed, 24 insertions, 1 deletions
@@ -1,3 +1,26 @@ # CPS Temporal Service -For now, this repo contains a very minimalist skeleton of the application.
\ No newline at end of file +For now, this repo contains a very minimalist skeleton of the application. + +## Local DB setup + +A Postgres instance with Timescale extension can be started by running the following command: + +``` +docker run --name postgres-cps-temporal -p 5433:5432 -d \ + -e POSTGRES_DB=cpstemporaldb \ + -e POSTGRES_USER=cpstemporal \ + -e POSTGRES_PASSWORD=cpstemporal \ + timescale/timescaledb:2.1.1-pg13 +``` + +[Liquibase](https://www.liquibase.org/) is used to manage database schema changes and versions. +Then, the database schema is updated when the application is started or by running the following command: + +``` +mvn org.liquibase:liquibase-maven-plugin:4.3.2:update \ + -Dliquibase.url=jdbc:postgresql://localhost:5433/cpstemporaldb \ + -Dliquibase.username=cpstemporal \ + -Dliquibase.password=cpstemporal \ + -Dliquibase.changeLogFile=db/changelog/changelog-master.xml +``` |