diff postgres/setupExtensions.sh @ 90:63cb9be89a26 production v1.0.0

flow: Merged <release> 'v1.0.0' to <master> ('production').
author smith@nwoca.org
date Thu, 22 Sep 2016 01:49:20 +0100
parents 53671513b240
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/postgres/setupExtensions.sh	Thu Sep 22 01:49:20 2016 +0100
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+export PGUSER=postgres
+result=`psql -t -A <<- EOSQL
+   SELECT 1 FROM pg_database WHERE datname='$DB_NAME';
+EOSQL`
+
+echo "Checking extensions on $DB_NAME ( $result )"
+if [[ $result == "1" ]]; then
+    psql $DB_NAME <<- EOSQL
+    CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
+EOSQL
+  echo "Set extensions on $DB_NAME"
+fi
+