5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 04:06:21 +00:00
panel/bin/migrate_database
2019-09-24 16:34:34 -03:00

18 lines
450 B
Bash
Executable file

#!/bin/sh
set -e
cd /srv/http
test -f data/production.sqlite3.migrated && exit 0
bundle exec rake db:data:dump_dir dir=data
cat config/database.yml.pg > config/database.yml
bundle exec rake db:schema:load
rm db/data/ar_internal_metadata.yml
mv db/data/active_storage_attachments.yml db/data/zz_active_storage_attachments.yml
bundle exec rake db:data:load_dir dir=data truncate=false
mv data/production.sqlite3 data/production.sqlite3.migrated