annotate postgres/setupExtensions.sh @ 406:3508fd2d323a production 2.14.0

flow: Merged <release> '2.14.0' to <master> ('production').
author Jason Klinger <klinger@nwoca.org>
date Fri, 20 May 2022 20:14:22 +0100
parents 53671513b240
children
rev   line source
3
0cdc167e6319 DEP-2: postgres dockerfile
smith@nwoca.org
parents:
diff changeset
1 #!/bin/bash
0cdc167e6319 DEP-2: postgres dockerfile
smith@nwoca.org
parents:
diff changeset
2
0cdc167e6319 DEP-2: postgres dockerfile
smith@nwoca.org
parents:
diff changeset
3 export PGUSER=postgres
81
53671513b240 DEP-10: add timezone and locale settings. add java base image. add native APR for tomcat
smith@nwoca.org
parents: 80
diff changeset
4 result=`psql -t -A <<- EOSQL
3
0cdc167e6319 DEP-2: postgres dockerfile
smith@nwoca.org
parents:
diff changeset
5 SELECT 1 FROM pg_database WHERE datname='$DB_NAME';
0cdc167e6319 DEP-2: postgres dockerfile
smith@nwoca.org
parents:
diff changeset
6 EOSQL`
0cdc167e6319 DEP-2: postgres dockerfile
smith@nwoca.org
parents:
diff changeset
7
81
53671513b240 DEP-10: add timezone and locale settings. add java base image. add native APR for tomcat
smith@nwoca.org
parents: 80
diff changeset
8 echo "Checking extensions on $DB_NAME ( $result )"
53671513b240 DEP-10: add timezone and locale settings. add java base image. add native APR for tomcat
smith@nwoca.org
parents: 80
diff changeset
9 if [[ $result == "1" ]]; then
80
5c093612ce89 DEP-10: add uuid extension to database
smith@nwoca.org
parents: 3
diff changeset
10 psql $DB_NAME <<- EOSQL
5c093612ce89 DEP-10: add uuid extension to database
smith@nwoca.org
parents: 3
diff changeset
11 CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
3
0cdc167e6319 DEP-2: postgres dockerfile
smith@nwoca.org
parents:
diff changeset
12 EOSQL
80
5c093612ce89 DEP-10: add uuid extension to database
smith@nwoca.org
parents: 3
diff changeset
13 echo "Set extensions on $DB_NAME"
3
0cdc167e6319 DEP-2: postgres dockerfile
smith@nwoca.org
parents:
diff changeset
14 fi
0cdc167e6319 DEP-2: postgres dockerfile
smith@nwoca.org
parents:
diff changeset
15