]> git.openstreetmap.org Git - rails.git/blobdiff - docker/postgres/openstreetmap-postgres-init.sh
Automatically enable the btree_gist extension
[rails.git] / docker / postgres / openstreetmap-postgres-init.sh
index d8c619d45fd90b0af0da764ab9d77e6bf43be536..53c0ba4549c9a2f46a9c72ebf26b5fb8f701dae5 100755 (executable)
@@ -2,10 +2,11 @@
 set -ex
 
 # Create 'openstreetmap' user
+# Password and superuser privilege are needed to successfully run test suite
 psql -v ON_ERROR_STOP=1 -U "$POSTGRES_USER" <<-EOSQL
-    CREATE USER openstreetmap PASSWORD 'openstreetmap';
+    CREATE USER openstreetmap SUPERUSER PASSWORD 'openstreetmap';
     GRANT ALL PRIVILEGES ON DATABASE openstreetmap TO openstreetmap;
 EOSQL
 
-# Create btree_gist extensions
-psql -v ON_ERROR_STOP=1 -U "$POSTGRES_USER" -c "CREATE EXTENSION btree_gist" openstreetmap
+# Define custom functions
+psql -v ON_ERROR_STOP=1 -U "$POSTGRES_USER" -f "/usr/local/share/osm-db-functions.sql" openstreetmap