26 lines
801 B
Python
26 lines
801 B
Python
import django.contrib.postgres.indexes
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
dependencies = [
|
|
("address", "0004_house_full_number"),
|
|
]
|
|
|
|
operations = [
|
|
migrations.AddField(
|
|
model_name="addressobject",
|
|
name="search_text",
|
|
field=models.TextField(blank=True, default="", verbose_name="Строка поиска"),
|
|
),
|
|
migrations.AddIndex(
|
|
model_name="addressobject",
|
|
index=django.contrib.postgres.indexes.GinIndex(
|
|
condition=models.Q(("is_active", True), ("level__in", (7, 8))),
|
|
fields=["search_text"],
|
|
name="addr_search_text_trgm",
|
|
opclasses=("gin_trgm_ops",),
|
|
),
|
|
),
|
|
]
|