view schema/README @ 172:a422471db08a

Automate running DB-tests with an extra database run_tests.sh allows to run database tests easily without affecting other existing databases and on a clean basis. Because roles are cluster-wide, they cannot be easily droped and recreated without affecting other databases. Thus, moved their creation to roles.sql and in passing removed unnecessary role 'gemma'.
author Tom Gottfried <tom@intevation.de>
date Thu, 12 Jul 2018 16:30:01 +0200
parents dad6cf39691e
children 68fd656c3d55
line wrap: on
line source

Build Dockerfile with e.g.:
$ docker build -t gemma .

Get a running instance with e.g.:
$ docker run --name gemma -d -p 54321:5432 -v $PWD:/opt/gemma gemma

Run tests for RLS policies as database superuser (within container) with:
$ ./run_tests.sh

Create ER diagrams with e.g.:
Auxiliary tables:
$ postgresql_autodoc -p 54321 -h $dockerhost \
      -d gemma -U sophie --password=so2Phie4 -t dot -l . -s 'gemma'
$ dot -Tpdf gemma.dot > gemma_auxiliary.pdf

Waterway related tables:
$ postgresql_autodoc -p 54321 -h $dockerhost \
      -d gemma -U sophie --password=so2Phie4 -t dot -l . -s 'gemma_waterway'
$ dot -Tpdf gemma.dot > gemma_waterway.pdf

Fairway/bottleneck related tables:
$ postgresql_autodoc -p 54321 -h $dockerhost \
      -d gemma -U sophie --password=so2Phie4 -t dot -l . -s 'gemma_fairway'
$ dot -Tpdf gemma.dot > gemma_fairway.pdf