From 799f060204660f667d8b66dcb272d73ef1b8c834 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=A7=CE=B3=CF=86=CF=84=20Kompanion?= Date: Sat, 18 Oct 2025 05:05:58 +0200 Subject: [PATCH] Tests: Make them callable from any path --- db/scripts/create-prod-db.sh | 2 +- db/scripts/create-test-db.sh | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/db/scripts/create-prod-db.sh b/db/scripts/create-prod-db.sh index 6652a42..ede56f6 100755 --- a/db/scripts/create-prod-db.sh +++ b/db/scripts/create-prod-db.sh @@ -16,7 +16,7 @@ DO $$ BEGIN END $$; SQL -for f in db/init/*.sql; do +for f in `dirname($0)`/*.sql; do echo "Applying $f" psql -d "$DB_NAME" -f "$f" done diff --git a/db/scripts/create-test-db.sh b/db/scripts/create-test-db.sh index 1329022..b1ac32d 100755 --- a/db/scripts/create-test-db.sh +++ b/db/scripts/create-test-db.sh @@ -9,7 +9,10 @@ DROP DATABASE IF EXISTS "$DB_NAME"; CREATE DATABASE "$DB_NAME" OWNER "$ROLE"; SQL -for f in db/init/*.sql; do +for f in `dirname($0)`/*.sql; do + if [[ "$f" == *"001_roles.sql"* ]]; then + continue + fi echo "Applying $f" psql -d "$DB_NAME" -f "$f" done