Reference constant in index declaration

This commit is contained in:
jeremystretch 2022-12-01 16:50:04 -05:00
parent 2d49fc2521
commit 774b154e47

View File

@ -53,13 +53,13 @@ class CachedValue(models.Model):
Index(
fields=['value'],
name='extras_cachedvalue_value',
condition=Q(LessThan(Length('value'), 1024))
condition=Q(LessThan(Length('value'), INDEX_MAX))
),
Index(
fields=['value'],
name='extras_cachedvalue_value_like',
opclasses=['text_pattern_ops'],
condition=Q(LessThan(Length('value'), 1024))
condition=Q(LessThan(Length('value'), INDEX_MAX))
),
)