1
0
mirror of https://github.com/django/django.git synced 2025-02-28 11:34:28 +00:00

only attempt to create the postgis extension when it does not already exist

This commit is contained in:
Thomas Schreiber 2013-12-31 03:31:21 +01:00 committed by Claude Paroz
parent 0b825adcf2
commit 7b119c1c77

View File

@ -89,7 +89,7 @@ class PostGISCreation(DatabaseCreation):
self.connection.close()
self.connection.settings_dict["NAME"] = test_database_name
cursor = self.connection.cursor()
cursor.execute("CREATE EXTENSION postgis")
cursor.execute("CREATE EXTENSION IF NOT EXISTS postgis")
cursor.connection.commit()
return test_database_name