diff --git a/scripts/diff.sh b/scripts/diff.sh index 196402e..7c48aa7 100755 --- a/scripts/diff.sh +++ b/scripts/diff.sh @@ -28,14 +28,8 @@ if [[ ! -f "$migration" ]]; then echo "migrate from $rev => HEAD" 1>&2 - echo "do language plpgsql \$migration\$" >> "$migration" - echo "begin" >> "$migration" - echo >> "$migration" migra --unsafe $base_url $head_url >> "$migration" \ || echo "migra exited with code $?. this is /probably/ fine" 1>&2 - echo >> "$migration" - echo "end;" >> "$migration" - echo '$migration$;' >> "$migration" fi echo "$migration" diff --git a/scripts/migrate.sh b/scripts/migrate.sh index e0f9106..0655323 100755 --- a/scripts/migrate.sh +++ b/scripts/migrate.sh @@ -26,7 +26,7 @@ else migration_file=$(./scripts/diff.sh "$last_revision") if [[ "$2" = "--greenlight" ]]; then - psql "$POSTGRES_URI/dnim" -f "$migration_file" + psql "$POSTGRES_URI/dnim" -v ON_ERROR_STOP=1 --single-transaction -f "$migration_file" else echo "migration available at $migration_file" echo "review and rerun with --greenlight to apply"