diff --git a/django/contrib/gis/db/backends/postgis/creation.py b/django/contrib/gis/db/backends/postgis/creation.py
index bad22be..1eac429 100644
a
|
b
|
class PostGISCreation(DatabaseCreation):
|
10 | 10 | from django.contrib.gis.db.models.fields import GeometryField |
11 | 11 | |
12 | 12 | output = super(PostGISCreation, self).sql_indexes_for_field(model, f, style) |
| 13 | postgis_version = self.connection.ops.spatial_version |
13 | 14 | |
14 | 15 | if isinstance(f, GeometryField): |
15 | 16 | gqn = self.connection.ops.geo_quote_name |
… |
… |
class PostGISCreation(DatabaseCreation):
|
38 | 39 | style.SQL_FIELD(qn(f.column)) + |
39 | 40 | style.SQL_KEYWORD(' SET NOT NULL') + ';') |
40 | 41 | |
41 | | |
42 | 42 | if f.spatial_index: |
43 | 43 | # Spatial indexes created the same way for both Geometry and |
44 | 44 | # Geography columns |
45 | | if f.geography: |
| 45 | # PostGIS 2.0 does not support GIST_GEOMETRY_OPS |
| 46 | if postgis_version >= (2, 0) or f.geography: |
46 | 47 | index_opts = '' |
47 | 48 | else: |
48 | 49 | index_opts = ' ' + style.SQL_KEYWORD(self.geom_index_opts) |