Skip to content

Instantly share code, notes, and snippets.

@pfaffman
Last active July 20, 2017 12:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pfaffman/441774b4d73bd180869cb306ffcebb0b to your computer and use it in GitHub Desktop.
Save pfaffman/441774b4d73bd180869cb306ffcebb0b to your computer and use it in GitHub Desktop.
Create a new database for Discourse
#!/usr/bin/env bash
if [ ! -f discourse.sublime-project ]
then
echo "Dude. There's no Discourse here."
exit
else
echo Killing any running rubies. . .
killall ruby
echo "=================================================="
echo "=================================================="
echo "=================================================="
echo "=================================================="
echo "=================================================="
echo "ABOUT TO DELETE EVERYTHING. . . . "
echo "=================================================="
echo "=================================================="
echo "=================================================="
echo "=================================================="
echo "=================================================="
sleep 5
echo "Here goes . . ."
rm -fr public/uploads
RAILS_ENV=development bundle exec rake db:drop db:create db:migrate
cat <<EOF | bundle exec rake admin:create
me@nowhere.com
secretpassword
secretpassword
EOF
echo Flushing Redis
redis-cli flushall
echo Done.
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment