link-stack/packages/metamigo-db/scripts/dump-db

18 lines
440 B
Text
Raw Normal View History

2023-02-13 12:41:30 +00:00
#!/usr/bin/env bash
if [ "$GM_DBURL" = "" ]; then
echo "This script should only be ran from inside graphile-migrate";
exit 1;
fi
export COMPOSE_PROJECT_NAME
# When ran inside docker-compose we need to be able to run a different pg_dump binary
${PG_DUMP:-pg_dump} \
--no-sync \
--schema-only \
--no-owner \
--exclude-schema=graphile_migrate \
--exclude-schema=graphile_worker \
--file=../../data/schema.sql \
"$GM_DBURL"