lemmy/scripts/dump_schema.sh
2023-12-26 18:26:29 -07:00

17 lines
375 B
Bash

#!/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