From 01ee432983e0a930870fb9e33e0c4e6ea23debc1 Mon Sep 17 00:00:00 2001 From: Orion Kindel Date: Thu, 20 Jul 2023 13:41:33 -0500 Subject: [PATCH] fix: migrate.sh should look for a migration before skipping --- scripts/migrate.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/migrate.sh b/scripts/migrate.sh index 7ba4b27..2a5d205 100755 --- a/scripts/migrate.sh +++ b/scripts/migrate.sh @@ -49,14 +49,14 @@ else if [[ -f "./migrations/${base}_skipped.sql" ]]; then echo "${base} (skipped)" continue - elif ! (schema_changed "$base"); then - echo "${base} (skipped, no changes to schema)" - continue elif [[ -f "./migrations/$mig" ]]; then head=$(echo $mig | awk -F'[_.]' '{print $3}') echo "${base} -> ${head}" query_file "$POSTGRES_URI/dnim" "./migrations/$mig" query "$POSTGRES_URI/dnim" "insert into migration (from_revision, to_revision) values ('$base', '$head');" + elif ! (schema_changed "$base"); then + echo "${base} (skipped, no changes to schema)" + continue else echo "cant find migration for $base" 1>&2 exit 1