Skip to content

Instantly share code, notes, and snippets.

@sefk
Last active August 29, 2015 14:21
Show Gist options
  • Save sefk/b044a5dfeda3e0a9fdfd to your computer and use it in GitHub Desktop.
Save sefk/b044a5dfeda3e0a9fdfd to your computer and use it in GitHub Desktop.
#!/bin/bash
set -u
set -e
read -r -p "This will nuke and reload your midas db, are you sure [y/N] " response
if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]
then
set -x
psql -c "drop database midas;"
psql -c "create database midas;"
psql -c "GRANT ALL PRIVILEGES ON DATABASE midas to midas;"
psql -c "ALTER SCHEMA public OWNER TO midas;"
npm run migrate
npm run init
npm run demo
psql midas -c "update midas_user set disabled='f';"
psql midas -c "update midas_user set \"isAdmin\"='t' where username='alan@test.gov';"
node app.js
set +x
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment