Browse files

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

… exist
  • Loading branch information...
1 parent 0b825ad commit 7b119c1c77c8e0d17b55088f83a1552c73ceb31c Thomas Schreiber committed with claudep Dec 31, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 django/contrib/gis/db/backends/postgis/creation.py
View
2 django/contrib/gis/db/backends/postgis/creation.py
@@ -89,7 +89,7 @@ def _create_test_db(self, verbosity, autoclobber):
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

0 comments on commit 7b119c1

Please sign in to comment.