Skip to content

Commit 0c59027

Browse files
committed
Add tour ids for the test users to DB
1 parent fd38732 commit 0c59027

File tree

4 files changed

+46
-3
lines changed

4 files changed

+46
-3
lines changed

dsw/docker-compose.template.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ services:
1010
volumes:
1111
- ./server/application.yml:/app/config/application.yml:ro
1212
- ./server/integration.yml:/app/config/integration.yml:ro
13-
depends_on:
13+
depends_on:
1414
- minio
1515
- postgres
1616

@@ -29,19 +29,22 @@ services:
2929
restart: always
3030
volumes:
3131
- ./docworker/config.yml:/app/config/application.yml:ro
32-
depends_on:
32+
depends_on:
3333
- minio
3434
- postgres
35-
35+
3636
postgres:
3737
image: postgres:15.2
38+
container_name: postgres
3839
restart: always
3940
ports:
4041
- 5432:5432
4142
environment:
4243
POSTGRES_USER: postgres
4344
POSTGRES_PASSWORD: postgres
4445
POSTGRES_DB: dsw
46+
volumes:
47+
- ./scripts/patch-db-wizard.sql:/scripts/patch-db-wizard.sql:ro
4548

4649
minio:
4750
image: minio/minio:RELEASE.2025-04-22T22-12-26Z

dsw/scripts/patch-db-wizard.sql

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
-- Define the constant tenant UUID
2+
WITH tenant AS (
3+
SELECT '00000000-0000-0000-0000-000000000000'::UUID AS tenant_uuid
4+
),
5+
-- Get all user UUIDs
6+
users AS (
7+
SELECT uuid AS user_uuid FROM user_entity
8+
),
9+
-- Define all tour IDs
10+
tours AS (
11+
SELECT unnest(ARRAY[
12+
'dashboard',
13+
'projects_create',
14+
'projects_detail',
15+
'projects_detail_share-modal',
16+
'projects_index',
17+
'users_edit_tours'
18+
]) AS tour_id
19+
)
20+
21+
-- Insert all combinations into user_tour
22+
INSERT INTO user_tour (user_uuid, tour_id, tenant_uuid, created_at)
23+
SELECT
24+
u.user_uuid,
25+
t.tour_id,
26+
tn.tenant_uuid,
27+
NOW()
28+
FROM users u
29+
CROSS JOIN tours t
30+
CROSS JOIN tenant tn;

dsw/scripts/patch-db.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
3+
PG_CONTAINER="postgres"
4+
PG_USER="postgres"
5+
PG_PASS="postgres"
6+
PG_DB="dsw"
7+
8+
9+
docker exec $PG_CONTAINER psql -U $PG_USER -d $PG_DB -f /scripts/patch-db-wizard.sql

scripts/start.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ docker pull --platform linux/amd64 $CLIENT_IMAGE
1515

1616
docker compose up -d
1717
./scripts/wait.sh
18+
./scripts/patch-db.sh
1819
./scripts/create-bucket.sh
1920
./scripts/wait-housekeeping.js

0 commit comments

Comments
 (0)