From 309bbd5fdbd948762587e0ea716d8b6d3fafa631 Mon Sep 17 00:00:00 2001 From: Orion Kindel Date: Wed, 19 Jul 2023 18:59:13 -0500 Subject: [PATCH] fix: gen-migrations workflow --- scripts/build.sh | 2 +- scripts/diff.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index 4a9d7ba..dce0848 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -22,7 +22,7 @@ url="postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$pg_host:$port" isready() { local waited=0 - until pg_isready -p "$port" 1>/dev/null; do + until pg_isready -h "$pg_host" -p "$port" 1>/dev/null; do if [[ "$waited" = "10" ]]; then pwd cat docker-compose.yml diff --git a/scripts/diff.sh b/scripts/diff.sh index 5e81a7e..4ddb278 100755 --- a/scripts/diff.sh +++ b/scripts/diff.sh @@ -27,7 +27,7 @@ if [[ ! -f "$migration" ]]; then ./scripts/build.sh base "$base" 1>&2 || (echo "base failed to build" && exit 1) ./scripts/build.sh head "$head" 1>&2 || (echo "head failed to build" && exit 1) - until pg_isready -p 5432 1>/dev/null && pg_isready -p 5433 1>/dev/null; do true; done; + until pg_isready -h "$pg_host" -p 5432 1>/dev/null && pg_isready -h "$pg_host" -p 5433 1>/dev/null; do true; done; migra --unsafe "$base_url" "$head_url" || echo "migra exited with code $?. this is /probably/ fine" 1>&2 else