comparison db_schema/setup-db.sh @ 866:d47e6b8f3897

Reorganise database setup scripts. First step towards better readability.
author Tom Gottfried <tom@intevation.de>
date Fri, 05 Feb 2016 17:01:28 +0100
parents e797391714a0
children 51051e85348f
comparison
equal deleted inserted replaced
865:186d30e5b44a 866:d47e6b8f3897
5 ROLE_PW=${2:-$ROLE_NAME} 5 ROLE_PW=${2:-$ROLE_NAME}
6 DB_NAME=${3:-$ROLE_NAME} 6 DB_NAME=${3:-$ROLE_NAME}
7 7
8 psql --command "CREATE USER $ROLE_NAME PASSWORD '$ROLE_PW';" 8 psql --command "CREATE USER $ROLE_NAME PASSWORD '$ROLE_PW';"
9 createdb -E UTF-8 $DB_NAME 9 createdb -E UTF-8 $DB_NAME
10
11 psql -d $DB_NAME --command \
12 "CREATE EXTENSION IF NOT EXISTS postgis WITH SCHEMA public"
13
14 psql -d $DB_NAME -f $DIR/stammdaten_schema.sql
10 psql -d $DB_NAME -f $DIR/lada_schema.sql 15 psql -d $DB_NAME -f $DIR/lada_schema.sql
11 psql -d $DB_NAME --command \ 16 psql -d $DB_NAME --command \
12 "GRANT USAGE ON SCHEMA stammdaten, bund, land TO $ROLE_NAME; 17 "GRANT USAGE ON SCHEMA stammdaten, bund, land TO $ROLE_NAME;
13 GRANT USAGE 18 GRANT USAGE
14 ON ALL SEQUENCES IN SCHEMA stammdaten, bund, land TO $ROLE_NAME; 19 ON ALL SEQUENCES IN SCHEMA stammdaten, bund, land TO $ROLE_NAME;
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)