mirror of
				https://github.com/django/django.git
				synced 2025-10-31 01:25:32 +00:00 
			
		
		
		
	[1.7.x] Fixed #23161: Drop PostGIS geography fields correctly
This commit is contained in:
		| @@ -99,7 +99,9 @@ class PostGISSchemaEditor(DatabaseSchemaEditor): | |||||||
|  |  | ||||||
|     def remove_field(self, model, field): |     def remove_field(self, model, field): | ||||||
|         from django.contrib.gis.db.models.fields import GeometryField |         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) |             super(PostGISSchemaEditor, self).remove_field(model, field) | ||||||
|         else: |         else: | ||||||
|             self.execute( |             self.execute( | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user