Fixes #11046: Restrict length of indexed search values (#11076)

* Fixes #11046: Restrict length of indexed search values

* Reference constant in index declaration

* Remove index from CachedValue.value
This commit is contained in:
Jeremy Stretch 2022-12-02 10:07:53 -05:00 committed by GitHub
parent 2577f3a786
commit 52cf9086a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View File

@ -2,6 +2,7 @@ import sys
import uuid
import django.db.models.deletion
import django.db.models.lookups
from django.core import management
from django.db import migrations, models
@ -39,7 +40,7 @@ class Migration(migrations.Migration):
('object_id', models.PositiveBigIntegerField()),
('field', models.CharField(max_length=200)),
('type', models.CharField(max_length=30)),
('value', models.TextField(db_index=True)),
('value', models.TextField()),
('weight', models.PositiveSmallIntegerField(default=1000)),
('object_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='contenttypes.contenttype')),
],

View File

@ -36,9 +36,7 @@ class CachedValue(models.Model):
type = models.CharField(
max_length=30
)
value = models.TextField(
db_index=True
)
value = models.TextField()
weight = models.PositiveSmallIntegerField(
default=1000
)