From bd67514937cfe48fe99f44cf22819a945dc016ea Mon Sep 17 00:00:00 2001 From: dullbananas Date: Sat, 23 Dec 2023 08:36:05 -0700 Subject: [PATCH] Create dump_schema.sh --- scripts/dump_schema.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 scripts/dump_schema.sh diff --git a/scripts/dump_schema.sh b/scripts/dump_schema.sh new file mode 100644 index 000000000..d60b14580 --- /dev/null +++ b/scripts/dump_schema.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +set -e + +# Dumps database schema, not including things added by replaceable_schema.sql + +source CWD="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)" + +cd $CWD/../ + +source scripts/start_dev_db.sh + +diesel migration run +pg_dump --no-owner --no-privileges --no-table-access-method --schema-only --no-sync -f schema.sqldump + +pg_ctl stop +rm -rf $PGDATA