Make Immich restore test create database

This commit is contained in:
2026-05-27 18:14:40 +02:00
parent 8a19c45485
commit 2e84700326
+6
View File
@@ -93,6 +93,12 @@ until docker exec restoretest-immich-postgres pg_isready -U immich -d immich >/d
sleep 2
done
# Einige Postgres-Images melden bereits "ready", bevor die per ENV
# gewuenschte Datenbank sichtbar ist. Der Smoke-Test legt die isolierte
# Test-DB deshalb defensiv an, falls sie noch fehlt.
docker exec restoretest-immich-postgres sh -lc \
'psql -U immich -d postgres -tAc "select 1 from pg_database where datname = '\''immich'\''" | grep -q 1 || createdb -U immich immich'
# Stufe 2: Dump in Test-Postgres importieren
# Hinweis: pg_restore mit --clean --if-exists, damit die Operation idempotent ist.
# --no-owner / --no-privileges, weil im Test-Postgres kein produktiver User existiert.