otwarchive-symphonyarchive/script/reset_database-prod.sh

29 lines
639 B
Bash
Raw Normal View History

2026-03-11 22:22:11 +00:00
#!/bin/bash
set -ex
case "${RAILS_ENV}" in
test)
bundle install
bundle exec rake db:reset_and_migrate
;;
production)
bundle install
bundle exec rake db:create
bundle exec rake db:reset
bundle exec rake db:migrate
bundle exec rake db:seed
bundle exec rake skins:load_site_skins
bundle exec rake search:index_tags
bundle exec rake search:index_works
bundle exec rake search:index_pseuds
bundle exec rake search:index_bookmarks
;;
*)
echo "Only supported in test and development (e.g. 'RAILS_ENV=test ./script/reset_database.sh')"
exit 1
;;
esac