Mercurial > lada > lada-server
comparison db_schema/setup-db.sh @ 1313:b5ab25b7ac2c
Stop on error any execution of SQL via psql in DB setup.
Though this duplicates respective \set commands in many scripts,
I leave them there because they might help in debugging anyhow.
Hopefully this change will improve prevention of adding broken SQL
like currently audit.sql.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Fri, 17 Mar 2017 12:52:23 +0100 |
parents | ba47994c1665 |
children | 46aa15c8cfb2 |
comparison
equal
deleted
inserted
replaced
1310:c5721e624c0e | 1313:b5ab25b7ac2c |
---|---|
29 echo "ROLE_NAME = $ROLE_NAME" | 29 echo "ROLE_NAME = $ROLE_NAME" |
30 ROLE_PW=${2:-$ROLE_NAME} | 30 ROLE_PW=${2:-$ROLE_NAME} |
31 echo "ROLE_PW = $ROLE_PW" | 31 echo "ROLE_PW = $ROLE_PW" |
32 DB_NAME=${3:-$ROLE_NAME} | 32 DB_NAME=${3:-$ROLE_NAME} |
33 echo "DB_NAME = $DB_NAME" | 33 echo "DB_NAME = $DB_NAME" |
34 | |
35 # Stop on error any execution of SQL via psql | |
36 DB_CONNECT_STRING="-v ON_ERROR_STOP=on " | |
34 | 37 |
35 # if variable DB_SRV and otional DB_PORT is set a remote database connection will be used | 38 # if variable DB_SRV and otional DB_PORT is set a remote database connection will be used |
36 if [ -n "$DB_SRV" ] ; then DB_CONNECT_STRING="-h $DB_SRV" ; fi | 39 if [ -n "$DB_SRV" ] ; then DB_CONNECT_STRING="-h $DB_SRV" ; fi |
37 if [ -n "$DB_SRV" -a -n "$DB_PORT" ] ; then | 40 if [ -n "$DB_SRV" -a -n "$DB_PORT" ] ; then |
38 DB_CONNECT_STRING="$DB_CONNECT_STRING -p $DB_PORT" | 41 DB_CONNECT_STRING="$DB_CONNECT_STRING -p $DB_PORT" |