recreate index

This commit is contained in:
zakhy 2025-06-05 17:00:37 +07:00
parent bdc8eedf3c
commit 2831b0493b
3 changed files with 49 additions and 4 deletions

View File

@ -0,0 +1,45 @@
# Generated by Django 3.2.25 on 2025-06-05 17:00
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('workerslocation', '0012_auto_20250605_1627'),
]
operations = [
migrations.RemoveIndex(
model_name='workerslocation',
name='workersloca_update__0a4688_idx',
),
migrations.RemoveIndex(
model_name='workerslocation',
name='workersloca_active_c3b753_idx',
),
migrations.RemoveIndex(
model_name='workerstracking',
name='workersloca_time_9a1c92_idx',
),
migrations.RemoveIndex(
model_name='workerstracking',
name='workersloca_worker__f6ee2a_idx',
),
migrations.AddIndex(
model_name='workerslocation',
index=models.Index(fields=['-update_time'], name='workersloca_update__16350c_idx'),
),
migrations.AddIndex(
model_name='workerslocation',
index=models.Index(fields=['active', '-update_time'], name='workersloca_active_991295_idx'),
),
migrations.AddIndex(
model_name='workerstracking',
index=models.Index(fields=['worker', '-time'], name='workersloca_worker__c2007b_idx'),
),
migrations.AddIndex(
model_name='workerstracking',
index=models.Index(fields=['-time'], name='workersloca_time_4b870c_idx'),
),
]

View File

@ -85,6 +85,6 @@ class WorkersLocation(models.Model):
indexes = [
models.Index(fields=["uid", ]),
models.Index(fields=["name", ]),
models.Index(fields=["update_time", ]),
models.Index(fields=["active", "update_time", ]),
models.Index(fields=["-update_time", ]),
models.Index(fields=["active", "-update_time", ]),
]

View File

@ -59,6 +59,6 @@ class WorkersTracking(models.Model): # Передвижение персона
verbose_name = "Передвижение сотрудника"
verbose_name_plural = "Передвижения сотрудников"
indexes = [
models.Index(fields=["worker", "time"]),
models.Index(fields=["time",]),
models.Index(fields=["worker", "-time"]),
models.Index(fields=["-time",]),
]