view postgres/setupExtensions.sh @ 80:5c093612ce89

DEP-10: add uuid extension to database
author smith@nwoca.org
date Fri, 08 Apr 2016 21:40:03 +0100
parents postgres/setupDatabase.sh@0cdc167e6319
children 53671513b240
line wrap: on
line source
#!/bin/bash

export PGUSER=postgres
TEST=`psql <<- EOSQL
   SELECT 1 FROM pg_database WHERE datname='$DB_NAME';
EOSQL`

if [[ $TEST == "1" ]]; then
    psql $DB_NAME <<- EOSQL
    CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
EOSQL
  echo "Set extensions on $DB_NAME"
fi