#!/usr/bin/env bash

PGPASSWORD=$DB_PASSWORD /usr/bin/psql --host $DB_HOST -U $DB_USERNAME $DB_NAME -c 'CREATE EXTENSION IF NOT EXISTS postgis;'
PGPASSWORD=$DB_PASSWORD /usr/bin/psql --host $DB_HOST -U $DB_USERNAME $DB_NAME -c 'CREATE EXTENSION IF NOT EXISTS postgis_topology;'

#!/usr/bin/env bash

DB_NAME=${1:-$DB_USERNAME}  # Until we move off template deploy and onto Kubernetes with the new DB

PGPASSWORD=$DB_PASSWORD /usr/bin/psql --host $DB_HOST -U $DB_USERNAME $DB_NAME -c 'CREATE EXTENSION IF NOT EXISTS postgis;'
PGPASSWORD=$DB_PASSWORD /usr/bin/psql --host $DB_HOST -U $DB_USERNAME $DB_NAME -c 'CREATE EXTENSION IF NOT EXISTS postgis_topology;'

Set DB_NAME to the value of DB_USERNAME if absent
Set DB_NAME to the value of DB_USERNAME if absent

For template deploy
