view db_schema/setup-db.sh @ 862:04bec189ca19

Check if current status stufe is lower or equal to the users funktion.
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 04 Feb 2016 13:50:24 +0100
parents e797391714a0
children d47e6b8f3897
line wrap: on
line source
#!/bin/sh
DIR=`dirname $0`

ROLE_NAME=${1:-lada}
ROLE_PW=${2:-$ROLE_NAME}
DB_NAME=${3:-$ROLE_NAME}

psql --command "CREATE USER $ROLE_NAME PASSWORD '$ROLE_PW';"
createdb -E UTF-8 $DB_NAME
psql -d $DB_NAME -f $DIR/lada_schema.sql
psql -d $DB_NAME --command \
     "GRANT USAGE ON SCHEMA stammdaten, bund, land TO $ROLE_NAME;
      GRANT USAGE
            ON ALL SEQUENCES IN SCHEMA stammdaten, bund, land TO $ROLE_NAME;
      GRANT SELECT, INSERT, UPDATE, DELETE, REFERENCES
            ON ALL TABLES IN SCHEMA stammdaten, bund, land TO $ROLE_NAME;"
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)