fix: migrate should work on empty db
This commit is contained in:
parent
f9fa3761b5
commit
a30fe1db00
@ -12,7 +12,7 @@ git submodule update --init migrations
|
|||||||
|
|
||||||
if [[ "$dnim_database_count" = "0" ]]; then
|
if [[ "$dnim_database_count" = "0" ]]; then
|
||||||
echo "fresh database"
|
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/{}"
|
ls ./schema/ | xargs -I{} bash -c "$(declare -f query_file); query_file \"$POSTGRES_URI/dnim\" ./schema/{}"
|
||||||
|
|
||||||
head=$(git rev-parse --short HEAD)
|
head=$(git rev-parse --short HEAD)
|
||||||
@ -59,6 +59,6 @@ else
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
done;
|
done;
|
||||||
|
|
||||||
query_file "$POSTGRES_URI/dnim" "migrations/ensure_seeded.sql"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
query_file "$POSTGRES_URI/dnim" "migrations/ensure_seeded.sql"
|
||||||
|
Loading…
Reference in New Issue
Block a user