mirror of
https://github.com/django/django.git
synced 2024-12-23 01:25:58 +00:00
Fixed PostGIS remove_field implementation
Fixed bad code introduced in 2f9d1576e8
.
This commit is contained in:
parent
2f9d1576e8
commit
1667e736a7
@ -92,12 +92,12 @@ 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):
|
||||
super(PostGISSchemaEditor, self).remove_field(model, field)
|
||||
|
||||
self.execute(
|
||||
self.sql_drop_geometry_column % {
|
||||
"table": self.geo_quote_name(model._meta.db_table),
|
||||
"column": self.geo_quote_name(field.column),
|
||||
}
|
||||
)
|
||||
else:
|
||||
self.execute(
|
||||
self.sql_drop_geometry_column % {
|
||||
"table": self.geo_quote_name(model._meta.db_table),
|
||||
"column": self.geo_quote_name(field.column),
|
||||
}
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user