Ticket #16455: 16455-r17171-v4.patch
File 16455-r17171-v4.patch, 1.5 KB (added by , 13 years ago) |
---|
-
django/contrib/gis/db/backends/postgis/creation.py
3 3 4 4 class PostGISCreation(DatabaseCreation): 5 5 geom_index_type = 'GIST' 6 geom_index_opts = 'GIST_GEOMETRY_OPS'7 6 8 7 def sql_indexes_for_field(self, model, f, style): 9 8 "Return any spatial index creation SQL for the field." … … 42 41 if f.spatial_index: 43 42 # Spatial indexes created the same way for both Geometry and 44 43 # Geography columns 45 if f.geography: 46 index_opts = '' 47 else: 48 index_opts = ' ' + style.SQL_KEYWORD(self.geom_index_opts) 44 49 45 output.append(style.SQL_KEYWORD('CREATE INDEX ') + 50 46 style.SQL_TABLE(qn('%s_%s_id' % (db_table, f.column))) + 51 47 style.SQL_KEYWORD(' ON ') + 52 48 style.SQL_TABLE(qn(db_table)) + 53 49 style.SQL_KEYWORD(' USING ') + 54 50 style.SQL_COLTYPE(self.geom_index_type) + ' ( ' + 55 style.SQL_FIELD(qn(f.column)) + index_opts +' );')51 style.SQL_FIELD(qn(f.column)) + ' );') 56 52 return output 57 53 58 54 def sql_table_creation_suffix(self):