forked from 0x2620/pandora
only add index flag if DB_GIN_TRGM is set
This commit is contained in:
parent
56f9e3f3d1
commit
577afd682e
3 changed files with 3 additions and 2 deletions
|
@ -133,7 +133,7 @@ attrs = {
|
|||
|
||||
'sortvalue': models.CharField(max_length=1000, null=True, db_index=True),
|
||||
#run this CREATE INDEX clip_clip_findvalue_idx ON clip_clip USING gin (findvalue gin_trgm_ops);
|
||||
'findvalue': models.TextField(null=True, db_index=True),
|
||||
'findvalue': models.TextField(null=True, db_index=settings.DB_GIN_TRGM),
|
||||
}
|
||||
for name in settings.CONFIG['clipLayers']:
|
||||
attrs[name] = models.BooleanField(default=False, db_index=True)
|
||||
|
|
|
@ -1295,7 +1295,7 @@ class ItemFind(models.Model):
|
|||
item = models.ForeignKey('Item', related_name='find', db_index=True)
|
||||
key = models.CharField(max_length=200, db_index=True)
|
||||
#CREATE INDEX item_itemfind_value_idx ON item_itemfind USING gin (value gin_trgm_ops);
|
||||
value = models.TextField(blank=True, db_index=True)
|
||||
value = models.TextField(blank=True, db_index=settings.DB_GIN_TRGM)
|
||||
|
||||
def __unicode__(self):
|
||||
return u"%s=%s" % (self.key, self.value)
|
||||
|
|
|
@ -183,6 +183,7 @@ ITEM_POSTER = join(SCRIPT_ROOT, 'poster')
|
|||
ITEM_ICON = join(SCRIPT_ROOT, 'item_icon')
|
||||
LIST_ICON = join(SCRIPT_ROOT, 'list_icon')
|
||||
|
||||
DB_GIN_TRGM = False
|
||||
|
||||
#you can ignore things below this line
|
||||
#=========================================================================
|
||||
|
|
Loading…
Reference in a new issue