add options for hstore and topology

pull/24/head
Etienne Trimaille 2015-07-22 14:24:37 +02:00
rodzic d8cf8f4296
commit 224e1e0cba
1 zmienionych plików z 18 dodań i 0 usunięć

Wyświetl plik

@ -70,6 +70,13 @@ RESULT=`su - postgres -c "psql -l | grep postgis | wc -l"`
if [[ ${RESULT} == '1' ]]
then
echo 'Postgis Already There'
if [ ${HSTORE} == "true" ]; then
echo 'HSTORE is only useful when you create the postgis database.'
fi
if [ ${TOPOLOGY} == "true" ]; then
echo 'TOPOLOGY is only useful when you create the postgis database.'
fi
else
echo "Postgis is missing, installing now"
# Note the dockerfile must have put the postgis.sql and spatialrefsys.sql scripts into /root/
@ -82,6 +89,17 @@ else
echo "Loading postgis extension"
su - postgres -c "psql template_postgis -c 'CREATE EXTENSION postgis;'"
if [ ${HSTORE} == "true" ]
then
echo "Enabling hstore in the template"
su - postgres -c "psql template_postgis -c 'CREATE EXTENSION hstore;'"
fi
if [ ${TOPOLOGY} == "true" ]
then
echo "Enabling topology in the template"
su - postgres -c "psql template_postgis -c 'CREATE EXTENSION postgis_topology;'"
fi
# Needed when importing old dumps using e.g ndims for constraints
echo "Loading legacy sql"
su - postgres -c "psql template_postgis -f $SQLDIR/legacy_minimal.sql"