only add index flag if DB_GIN_TRGM is set

This commit is contained in:
j 2012-03-27 13:26:51 +02:00
commit 577afd682e
3 changed files with 3 additions and 2 deletions

View file

@ -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)