diff --git a/install.sh b/install.sh index 8141b3f..7f6ce83 100755 --- a/install.sh +++ b/install.sh @@ -377,6 +377,12 @@ wait_for_compose_health() { } docker compose --env-file "$ENV_FILE" -f "$E_COMPOSE" -p "$E_PROJECT" up -d postgres valkey +# A previous interrupted install may have initialized the volume with a +# different generated role password. Reconcile it through the local Postgres +# socket before running migrations; no data is dropped. +docker compose --env-file "$ENV_FILE" -f "$E_COMPOSE" -p "$E_PROJECT" exec -T postgres \ + psql -U postgres -d postgres -v ON_ERROR_STOP=1 \ + -c "ALTER ROLE product_e WITH PASSWORD '$E_POSTGRES_PASSWORD';" >/dev/null docker compose --env-file "$ENV_FILE" -f "$E_COMPOSE" -p "$E_PROJECT" run --rm --no-deps e-server migrate -config /etc/overcooked-e/config.yaml docker compose --env-file "$ENV_FILE" -f "$S_COMPOSE" -p "$S_PROJECT" up -d postgres valkey docker compose --env-file "$ENV_FILE" -f "$S_COMPOSE" -p "$S_PROJECT" run --rm --no-deps s-migrate