Last active
December 6, 2015 22:56
-
-
Save matthewberryman/03e56417f9bc8fa7cdd1 to your computer and use it in GitHub Desktop.
fresh-cognicity-database
This file contains 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
#!/usr/bin/env bash | |
# assumes https://github.com/smart-facility/cognicity-schema and https://github.com/smart-facility/cognicity-reports | |
# both checked out using default directory names (matching trailing part of url) | |
createdb -U postgres -h $DB_HOST -E utf8 cognicity | |
cd cognicity-schema | |
psql -U postgres -h $DB_HOST -d cognicity -f schema.sql | |
cd sample_data/infrastructure | |
find . -name '*.sql' -exec psql -U postgres -h $DB_HOST -d cognicity -f {} ';' | |
cd ../municipal_boundaries | |
find . -name '*.sql' -exec psql -U postgres -h $DB_HOST -d cognicity -f {} ';' | |
cd ../../../cognicity-reports | |
find . -name 'update_schema_*.sql' -exec psql -U postgres -h $DB_HOST -d cognicity -f {} ';' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment