comparison db_schema/setup-db.sh @ 854:e797391714a0

Allow setting variables via commandline.
author Tom Gottfried <tom@intevation.de>
date Tue, 02 Feb 2016 15:03:29 +0100
parents 9d2070b84238
children d47e6b8f3897
comparison
equal deleted inserted replaced
853:2ce24e2baf20 854:e797391714a0
1 #!/bin/sh 1 #!/bin/sh
2 DIR=`dirname $0` 2 DIR=`dirname $0`
3 3
4 ROLE_NAME=lada 4 ROLE_NAME=${1:-lada}
5 ROLE_PW=lada 5 ROLE_PW=${2:-$ROLE_NAME}
6 DB_NAME=lada 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 psql -d $DB_NAME -f $DIR/lada_schema.sql 10 psql -d $DB_NAME -f $DIR/lada_schema.sql
11 psql -d $DB_NAME --command \ 11 psql -d $DB_NAME --command \
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)