Skip to content

Commit

Permalink
Sync changes from TRS DB into DQT reporting database
Browse files Browse the repository at this point in the history
  • Loading branch information
gunndabad committed Aug 7, 2024
1 parent 9cd04f9 commit 451c3f2
Show file tree
Hide file tree
Showing 17 changed files with 4,940 additions and 46 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/dbml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,21 @@ jobs:
--health-interval 10s
--health-timeout 5s
--health-retries 5
volumes:
- ./init-db.sh:/docker-entrypoint-initdb.d/init-db.sh
ports:
- 5432:5432

steps:
- uses: actions/checkout@v4

- name: Create postgres configuration
run: |
echo '#!/bin/bash' > init-db.sh
echo 'echo "ALTER SYSTEM SET wal_level = '\''logical'\'';" > /docker-entrypoint-initdb.d/001-wal_level.sql' >> init-db.sh
echo 'pg_ctl -D "$PGDATA" restart' >> init-db.sh
chmod +x init-db.sh
- uses: extractions/setup-just@v2

- name: Install postgresql-client
Expand Down
22 changes: 20 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ jobs:

services:
postgres:
image: postgres
image: postgres:15
env:
POSTGRES_PASSWORD: trs
POSTGRES_DB: trs
options: >-
--name postgres
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
Expand All @@ -37,6 +38,14 @@ jobs:
with:
submodules: recursive

- name: Set postgres wal_level to logical
run: |
docker exec -i postgres bash << EOF
echo "wal_level = logical" >> /var/lib/postgresql/data/postgresql.conf
EOF
docker restart --time 0 postgres
- uses: extractions/setup-just@v2

- name: Install tools
Expand Down Expand Up @@ -192,7 +201,7 @@ jobs:

services:
postgres:
image: postgres
image: postgres:15
env:
POSTGRES_PASSWORD: trs
POSTGRES_DB: trs
Expand All @@ -201,6 +210,8 @@ jobs:
--health-interval 10s
--health-timeout 5s
--health-retries 5
volumes:
- ./init-db.sh:/docker-entrypoint-initdb.d/init-db.sh
ports:
- 5432:5432
mssql:
Expand All @@ -220,6 +231,13 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Create postgres configuration
run: |
echo '#!/bin/bash' > init-db.sh
echo 'echo "ALTER SYSTEM SET wal_level = '\''logical'\'';" > /docker-entrypoint-initdb.d/001-wal_level.sql' >> init-db.sh
echo 'pg_ctl -D "$PGDATA" restart' >> init-db.sh
chmod +x init-db.sh
- uses: extractions/setup-just@v2

- uses: Azure/login@v2
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ just install-tools
Install Postgres then set a connection string configuration entry in user secrets for running the apps and another for running the tests.
Note you should use a different database for tests as the test database will be cleared down whenever tests are run.

The server's `wal_level` must be set to `logical`:
```
ALTER SYSTEM SET wal_level = logical;
```
You may have to restart the server after amending this configuration.

e.g.
```shell
just set-secret ConnectionStrings:DefaultConnection "Host=localhost;Username=postgres;Password=your_postgres_password;Database=trs"
Expand Down
Loading

0 comments on commit 451c3f2

Please sign in to comment.