otwarchive-sunsetarchive/script/reset_database-prod.sh
2026-03-17 01:16:49 -04:00

27 lines
638 B
Bash
Executable file

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