sutty/bin/migrate_database

19 lines
450 B
Text
Raw Permalink Normal View History

2019-09-24 17:56:04 +00:00
#!/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
2019-09-24 19:34:34 +00:00
bundle exec rake db:data:load_dir dir=data truncate=false
2019-09-24 17:56:04 +00:00
mv data/production.sqlite3 data/production.sqlite3.migrated