From d98b3c77b698c032f74faa629b4b7bdd3ddad3ca Mon Sep 17 00:00:00 2001 From: Alexandre Date: Sat, 15 Feb 2025 09:34:04 +0100 Subject: [PATCH] Update database creation --- immich/rootfs/etc/cont-init.d/99-run.sh | 43 ++++++++++++------------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/immich/rootfs/etc/cont-init.d/99-run.sh b/immich/rootfs/etc/cont-init.d/99-run.sh index 0f39ac254..d1c2927b8 100755 --- a/immich/rootfs/etc/cont-init.d/99-run.sh +++ b/immich/rootfs/etc/cont-init.d/99-run.sh @@ -118,40 +118,37 @@ EOF setup_database() { bashio::log.info "Setting up external PostgreSQL database..." - # Ensure the user exists (or create/update if necessary) - if ! psql "postgres://${DB_USERNAME}:${DB_PASSWORD}@${DB_HOSTNAME}:${DB_PORT}/postgres" -tAc \ - "SELECT 1 FROM pg_roles WHERE rolname='${DB_USERNAME}';" | grep -q 1; then - bashio::log.info "User ${DB_USERNAME} does not exist. Creating it now..." - psql "postgres://${DB_USERNAME}:${DB_PASSWORD}@${DB_HOSTNAME}:${DB_PORT}" <