Попытка оптимизации #3 (Индексы)

This commit is contained in:
zakhy 2025-06-06 12:53:59 +07:00
parent 7912998c94
commit 3f38f5f17e
2 changed files with 26 additions and 2 deletions

View File

@ -0,0 +1,25 @@
# Generated by Django 3.2.25 on 2025-06-06 12:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('workerslocation', '0016_auto_20250606_1104'),
]
operations = [
migrations.RemoveIndex(
model_name='workerstracking',
name='workersloca_worker__d7aec1_idx',
),
migrations.RemoveIndex(
model_name='workerstracking',
name='workersloca_time_9a1c92_idx',
),
migrations.AddIndex(
model_name='workerstracking',
index=models.Index(fields=['worker', 'time'], name='workersloca_worker__f6ee2a_idx'),
),
]

View File

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