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