This repository was archived by the owner on Dec 13, 2022. It is now read-only.
File tree 5 files changed +54
-4
lines changed
5 files changed +54
-4
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -60,4 +60,5 @@ RUN set -ex \
60
60
&& rm -rf /usr/src/postgis \
61
61
&& apk del .fetch-deps .build-deps .build-deps-testing
62
62
63
- COPY 00-extensions.sql /docker-entrypoint-initdb.d/
63
+ COPY init-sequelize-db.sh /docker-entrypoint-initdb.d/
64
+ COPY update-sequelize-db.sh /usr/local/bin
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ set -e
4
+
5
+ # Perform all actions as $POSTGRES_USER
6
+ export PGUSER=" $POSTGRES_USER "
7
+
8
+ # Load PostGIS into both template_database and $POSTGRES_DB
9
+ for DB in template_postgis " $POSTGRES_DB " ; do
10
+ echo " Loading PostGIS extensions into $DB "
11
+ " ${psql[@]} " --dbname=" $DB " << -'EOSQL '
12
+ CREATE EXTENSION IF NOT EXISTS postgis;
13
+ CREATE EXTENSION IF NOT EXISTS btree_gist;
14
+ CREATE EXTENSION IF NOT EXISTS hstore;
15
+ EOSQL
16
+ done
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ set -e
4
+
5
+ # Perform all actions as $POSTGRES_USER
6
+ export PGUSER=" $POSTGRES_USER "
7
+
8
+ POSTGIS_VERSION=" ${POSTGIS_VERSION%% +* } "
9
+
10
+ # Load PostGIS into both template_database and $POSTGRES_DB
11
+ for DB in template_postgis " $POSTGRES_DB " " ${@ } " ; do
12
+ echo " Updating PostGIS extensions '$DB ' to $POSTGIS_VERSION "
13
+ psql --dbname=" $DB " -c "
14
+ -- Upgrade PostGIS (includes raster)
15
+ CREATE EXTENSION IF NOT EXISTS postgis VERSION '$POSTGIS_VERSION ';
16
+ ALTER EXTENSION postgis UPDATE TO '$POSTGIS_VERSION ';
17
+ "
18
+ done
Original file line number Diff line number Diff line change
1
+ # Sequelize PostGIS
2
+
3
+ Postgres image for Sequelize with support for essential extensions
4
+
5
+ ## Known Issues / Errors
6
+
7
+ If you encounter errors due to PostGIS update
8
+
9
+ ``` bash
10
+ OperationalError: could not access file " $libdir /postgis-X.X"
11
+ ```
12
+
13
+ Run
14
+
15
+ ``` bash
16
+ docker exec postgres-95 update-sequelize-db.sh
17
+ ```
18
+
You can’t perform that action at this time.
0 commit comments