Last active
August 29, 2015 14:21
-
-
Save sefk/b044a5dfeda3e0a9fdfd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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='[email protected]';" | |
node app.js | |
set +x | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment