forked from 0x2620/pandora
print local name and ip in vm terminal, document trigram index
This commit is contained in:
parent
82d939e6e3
commit
0042546d6c
5 changed files with 90 additions and 10 deletions
|
|
@ -132,7 +132,6 @@ attrs = {
|
|||
'volume': models.FloatField(default=0, null=True, db_index=True),
|
||||
|
||||
'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=settings.DB_GIN_TRGM),
|
||||
}
|
||||
for name in settings.CONFIG['clipLayers']:
|
||||
|
|
|
|||
21
pandora/item/management/commands/sqlfindindex.py
Normal file
21
pandora/item/management/commands/sqlfindindex.py
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# vi:si:et:sw=4:sts=4:ts=4
|
||||
|
||||
from django.core.management.base import BaseCommand
|
||||
from django.conf import settings
|
||||
|
||||
import monkey_patch.models
|
||||
from ... import models
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
"""
|
||||
print sql statement to add trigram
|
||||
"""
|
||||
help = 'sql create statements for find tables to use trigram index'
|
||||
args = ''
|
||||
|
||||
def handle(self, **options):
|
||||
print 'CREATE INDEX item_itemfind_value_idx ON item_itemfind USING gin (value gin_trgm_ops);'
|
||||
print ''
|
||||
print 'CREATE INDEX clip_clip_findvalue_idx ON clip_clip USING gin (findvalue gin_trgm_ops);'
|
||||
|
|
@ -1297,7 +1297,6 @@ 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=settings.DB_GIN_TRGM)
|
||||
|
||||
def __unicode__(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue