Ticket #9858: creation_patch_for_gis_test

File creation_patch_for_gis_test, 725 bytes (added by Aryeh Leib Taurog <vim@…>, 6 years ago)
Line 
1Index: db/backend/postgis/creation.py
2===================================================================
3--- db/backend/postgis/creation.py      (revision 1)
4+++ db/backend/postgis/creation.py      (working copy)
5@@ -37,6 +37,11 @@
6     # Constructing the necessary SQL to create the database (the DATABASE_USER
7     #  must possess the privileges to create a database)
8     create_sql = 'CREATE DATABASE %s' % connection.ops.quote_name(db_name)
9+
10+    # use the postgis template to create the spatial db with necessary sp's
11+    if hasattr(settings, 'POSTGIS_TEMPLATE'):
12+        create_sql += ' TEMPLATE %s' % settings.POSTGIS_TEMPLATE
13+
14     if settings.DATABASE_USER:
15         create_sql += ' OWNER %s' % settings.DATABASE_USER
16 
Back to Top