Kaydet (Commit) d4f62a7a authored tarafından Andrew Godwin's avatar Andrew Godwin

Fixed #23161: Drop PostGIS geography fields correctly

üst 059f5d17
......@@ -99,7 +99,9 @@ class PostGISSchemaEditor(DatabaseSchemaEditor):
def remove_field(self, model, field):
from django.contrib.gis.db.models.fields import GeometryField
if not isinstance(field, GeometryField) or self.connection.ops.spatial_version > (2, 0):
if not isinstance(field, GeometryField) or \
self.connection.ops.spatial_version > (2, 0) or \
field.geography:
super(PostGISSchemaEditor, self).remove_field(model, field)
else:
self.execute(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment