fix(deploy): sync DB password via ALTER USER depuis socket local postgres
Le volume postgres a ete init avec un mot de passe different de .env.docker. ALTER USER depuis l'interieur du conteneur (pas besoin d'auth sur socket local) aligne le mot de passe DB avec POSTGRES_PASSWORD de .env.docker.
This commit is contained in:
@@ -152,6 +152,13 @@ fi
|
||||
|
||||
wait_for_postgres || exit 1
|
||||
|
||||
# Sync DB password: postgres local socket doesn't need auth, so we can
|
||||
# ALTER USER to match whatever POSTGRES_PASSWORD is in .env.docker.
|
||||
# This fixes P1000 auth failures when the volume was initialized with a different password.
|
||||
docker compose exec -T postgres psql -U "${POSTGRES_USER:-memento}" -d "${POSTGRES_DB:-memento}" -c \
|
||||
"ALTER USER \"${POSTGRES_USER:-memento}\" WITH PASSWORD '${POSTGRES_PASSWORD:-memento}';" \
|
||||
2>/dev/null && echo "DB password synced" || echo "WARN: could not sync DB password"
|
||||
|
||||
docker compose exec -T postgres sh -c 'psql -U "$POSTGRES_USER" -d "$POSTGRES_DB" -c "CREATE EXTENSION IF NOT EXISTS vector;"' >/dev/null
|
||||
|
||||
if git diff --name-only HEAD~1 HEAD 2>/dev/null | grep -q '^memento-note/prisma/migrations/'; then
|
||||
|
||||
Reference in New Issue
Block a user