kopia lustrzana https://github.com/kartoza/docker-postgis
enable hstore and topology by default
rodzic
ce33b11509
commit
1efb4aba27
|
@ -51,6 +51,15 @@ fi
|
||||||
if [ -z "$POSTGRES_PASS" ]; then
|
if [ -z "$POSTGRES_PASS" ]; then
|
||||||
POSTGRES_PASS=docker
|
POSTGRES_PASS=docker
|
||||||
fi
|
fi
|
||||||
|
# Enable hstore and topology by default
|
||||||
|
if [ -z "$HSTORE" ]; then
|
||||||
|
HSTORE=true
|
||||||
|
fi
|
||||||
|
if [ -z "$TOPOLOGY" ]; then
|
||||||
|
TOPOLOGY=docker
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# redirect user/pass into a file so we can echo it into
|
# redirect user/pass into a file so we can echo it into
|
||||||
# docker logs when container starts
|
# docker logs when container starts
|
||||||
# so that we can tell user their password
|
# so that we can tell user their password
|
||||||
|
@ -71,10 +80,10 @@ if [[ ${RESULT} == '1' ]]
|
||||||
then
|
then
|
||||||
echo 'Postgis Already There'
|
echo 'Postgis Already There'
|
||||||
|
|
||||||
if [ ${HSTORE} == "true" ]; then
|
if [[ ${HSTORE} == "true" ]]; then
|
||||||
echo 'HSTORE is only useful when you create the postgis database.'
|
echo 'HSTORE is only useful when you create the postgis database.'
|
||||||
fi
|
fi
|
||||||
if [ ${TOPOLOGY} == "true" ]; then
|
if [[] ${TOPOLOGY} == "true" ]]; then
|
||||||
echo 'TOPOLOGY is only useful when you create the postgis database.'
|
echo 'TOPOLOGY is only useful when you create the postgis database.'
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
@ -89,12 +98,12 @@ else
|
||||||
echo "Loading postgis extension"
|
echo "Loading postgis extension"
|
||||||
su - postgres -c "psql template_postgis -c 'CREATE EXTENSION postgis;'"
|
su - postgres -c "psql template_postgis -c 'CREATE EXTENSION postgis;'"
|
||||||
|
|
||||||
if [ ${HSTORE} == "true" ]
|
if [[ ${HSTORE} == "true" ]]
|
||||||
then
|
then
|
||||||
echo "Enabling hstore in the template"
|
echo "Enabling hstore in the template"
|
||||||
su - postgres -c "psql template_postgis -c 'CREATE EXTENSION hstore;'"
|
su - postgres -c "psql template_postgis -c 'CREATE EXTENSION hstore;'"
|
||||||
fi
|
fi
|
||||||
if [ ${TOPOLOGY} == "true" ]
|
if [[ ${TOPOLOGY} == "true" ]]
|
||||||
then
|
then
|
||||||
echo "Enabling topology in the template"
|
echo "Enabling topology in the template"
|
||||||
su - postgres -c "psql template_postgis -c 'CREATE EXTENSION postgis_topology;'"
|
su - postgres -c "psql template_postgis -c 'CREATE EXTENSION postgis_topology;'"
|
||||||
|
|
Ładowanie…
Reference in New Issue