From e6aaf0aa6b06e5f282acb358daf0228acd63368f Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 31 Jan 2013 11:19:21 +0000 Subject: [PATCH] fix partial findvalue commit --- pandora/item/management/commands/sqlfindindex.py | 5 ----- pandora/item/management/commands/sync_itemsort.py | 13 ++----------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/pandora/item/management/commands/sqlfindindex.py b/pandora/item/management/commands/sqlfindindex.py index c6d99af3d..88ca8144e 100644 --- a/pandora/item/management/commands/sqlfindindex.py +++ b/pandora/item/management/commands/sqlfindindex.py @@ -42,8 +42,3 @@ class Command(BaseCommand): name = 'findvalue' if name not in indexes: create_table("%s_%s_idx"%(table_name, name), table_name, name) - for name in settings.CONFIG['clipLayers']: - name = '%s_findvalue' % name - if name not in indexes: - create_table("%s_%s_idx"%(table_name, name), table_name, name) - diff --git a/pandora/item/management/commands/sync_itemsort.py b/pandora/item/management/commands/sync_itemsort.py index 03080210f..dd4ac590a 100644 --- a/pandora/item/management/commands/sync_itemsort.py +++ b/pandora/item/management/commands/sync_itemsort.py @@ -76,10 +76,6 @@ class Command(BaseCommand): if name not in model_fields: sql = 'ALTER TABLE "%s" DROP COLUMN "%s"' % (table_name, name) changes.append(sql) - if settings.DB_GIN_TRGM: - gin_indexes = ['%s_findvalue' % n for n in settings.CONFIG['clipLayers']] - else: - gin_indexes = [] for f in clip.models.Clip._meta.fields: if not f.primary_key and not isinstance(f, fields.related.ForeignKey): name = f.name @@ -87,13 +83,8 @@ class Command(BaseCommand): if name not in db_fields: sql = 'ALTER TABLE "%s" ADD COLUMN "%s" %s' % (table_name, name, col_type) changes.append(sql) - if name in gin_indexes: - sql = 'CREATE INDEX "%s_%s_idx" ON "%s" USING gin ("%s" gin_trgm_ops);' % ( - table_name, name, table_name, name - ) - else: - sql = 'CREATE INDEX "%s_%s_idx" ON "%s" ("%s")' % (table_name, name, - table_name, name) + sql = 'CREATE INDEX "%s_%s_idx" ON "%s" ("%s")' % (table_name, name, + table_name, name) changes.append(sql) sql = 'ALTER TABLE "%s" ALTER COLUMN "%s" SET NOT NULL' % (table_name, name) changes.append(sql)