fix: migrate should work on empty db

This commit is contained in:
Orion Kindel 2023-07-20 12:12:11 -05:00
parent f9fa3761b5
commit a30fe1db00
Signed by untrusted user who does not match committer: orion
GPG Key ID: 6D4165AE4C928719

View File

@ -12,7 +12,7 @@ git submodule update --init migrations
if [[ "$dnim_database_count" = "0" ]]; then
echo "fresh database"
query "$POSTGRES_URI/postgres" "create database dnim;"
psql --quiet "$POSTGRES_URI/postgres" -c "create database dnim;"
ls ./schema/ | xargs -I{} bash -c "$(declare -f query_file); query_file \"$POSTGRES_URI/dnim\" ./schema/{}"
head=$(git rev-parse --short HEAD)
@ -59,6 +59,6 @@ else
exit 1
fi
done;
query_file "$POSTGRES_URI/dnim" "migrations/ensure_seeded.sql"
fi
query_file "$POSTGRES_URI/dnim" "migrations/ensure_seeded.sql"