Created
September 7, 2016 21:25
-
-
Save mrstebo/5cde2c4c39b97293aede00aabd1cf91e to your computer and use it in GitHub Desktop.
Bash script for setting up Postgres for a local rails application
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/sh | |
| echo -n "Please enter the username you want to add: " | |
| read USERNAME | |
| echo -n "Please enter the password for ${USERNAME} (will not be shown): " | |
| read -s PASSWORD | |
| echo "" | |
| psql -U postgres -c "create user ${USERNAME} with password '${PASSWORD}';" | |
| psql -U postgres -c "alter user ${USERNAME} superuser;" | |
| echo "You should be able to run 'rails db:setup' or 'rake db:setup' to create your databases" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment