Last active
June 26, 2018 22:52
-
-
Save davidmfoley/c40c199d096dfdb66b92e622adef5274 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
DB_URLS = ( \ | |
postgres://localhost/test_1 \ | |
postgres://localhost/test_2 \ | |
) | |
for db_url in "${DB_URLS[@]}"; do | |
echo "creating database `basename $db_url`" | |
createdb `basename $db_url` > /dev/null 2>&1 | |
psql $db_url -c 'drop schema public cascade; create schema public;' -o /dev/null 2>/dev/null | |
psql $db_url -f "path/to/your/schema.sql" > /dev/null 2>/dev/null | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment