Skip to content
This repository
Browse code

fixed table swapping with custom indices

  • Loading branch information...
commit 172593faf17c806eae374dcf971d5b1a7ab7655d 1 parent 40d6d22
Oliver Tonnhofer authored August 16, 2012

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. 4  imposm/db/postgis.py
4  imposm/db/postgis.py
@@ -277,7 +277,7 @@ def swap_tables(self, new_prefix, existing_prefix, backup_prefix):
277 277
             cur.execute('ALTER TABLE "%s" RENAME TO "%s"' % (table_name, rename_to))
278 278
 
279 279
             for idx in existing_indexes:
280  
-                if idx in (table_name + '_geom', table_name + '_pkey') or idx.startswith(table_name + '_trgm_idx_'):
  280
+                if idx in (table_name + '_geom', table_name + '_pkey') or idx.startswith(table_name + '_trgm_idx_') or idx.startswith(table_name + '_idx_'):
281 281
                     new_idx = idx.replace(table_name, rename_to, 1)
282 282
                     cur.execute('ALTER INDEX "%s" RENAME TO "%s"' % (idx, new_idx))
283 283
             if table_name + '_id_seq' in existing_seq:
@@ -291,7 +291,7 @@ def swap_tables(self, new_prefix, existing_prefix, backup_prefix):
291 291
             cur.execute('ALTER TABLE "%s" RENAME TO "%s"' % (table_name, rename_to))
292 292
 
293 293
             for idx in new_indexes:
294  
-                if idx in (table_name + '_geom', table_name + '_pkey') or idx.startswith(table_name + '_trgm_idx_'):
  294
+                if idx in (table_name + '_geom', table_name + '_pkey') or idx.startswith(table_name + '_trgm_idx_') or idx.startswith(table_name + '_idx_'):
295 295
                     new_idx = idx.replace(table_name, rename_to, 1)
296 296
                     cur.execute('ALTER INDEX "%s" RENAME TO "%s"' % (idx, new_idx))
297 297
             if table_name + '_id_seq' in new_seq:

0 notes on commit 172593f

Please sign in to comment.
Something went wrong with that request. Please try again.