mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 11:37:08 +00:00
Let create_survey take an explicity schema name
This commit is contained in:
@@ -42,7 +42,7 @@ PGDATABASE=${PGDATABASE:-dougal}
|
|||||||
LAST_SURVEY_ID=$(psql -U $PGUSER -h $PGHOST -Atc '\dn survey_[0-9]+' "$PGDATABASE" |sed -rn 's/^survey_([0-9]+).*$/\1/p' |sort -n |tail -n 1)
|
LAST_SURVEY_ID=$(psql -U $PGUSER -h $PGHOST -Atc '\dn survey_[0-9]+' "$PGDATABASE" |sed -rn 's/^survey_([0-9]+).*$/\1/p' |sort -n |tail -n 1)
|
||||||
NEXT_SURVEY_ID=$((LAST_SURVEY_ID+1))
|
NEXT_SURVEY_ID=$((LAST_SURVEY_ID+1))
|
||||||
|
|
||||||
SCHEMA_NAME="survey_$NEXT_SURVEY_ID"
|
SCHEMA_NAME="${SCHEMA_NAME:-survey_$NEXT_SURVEY_ID}"
|
||||||
|
|
||||||
[[ $# -ne 3 ]] && {
|
[[ $# -ne 3 ]] && {
|
||||||
echo "Wrong number of arguments"
|
echo "Wrong number of arguments"
|
||||||
|
|||||||
Reference in New Issue
Block a user