Смена индексов

This commit is contained in:
zakhy 2025-06-06 13:08:00 +07:00
parent a4340b9445
commit 59fa3bc096
3 changed files with 24 additions and 3 deletions

View File

@ -0,0 +1,21 @@
# Generated by Django 3.2.25 on 2025-06-06 13:07
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('gto', '0023_auto_20250606_1100'),
]
operations = [
migrations.RemoveIndex(
model_name='equipmenttracking',
name='gto_equipme_time_ffb373_idx',
),
migrations.AddIndex(
model_name='equipmenttracking',
index=models.Index(fields=['time', 'equipment'], name='gto_equipme_time_9d5580_idx'),
),
]

View File

@ -63,6 +63,6 @@ class EquipmentTracking(models.Model): # Передвижение оборуд
verbose_name_plural = "Передвижение оборудования"
indexes = [
models.Index(fields=["eventid"]),
models.Index(fields=["time"]),
models.Index(fields=["equipment", "time"]),
models.Index(fields=["time", "equipment"]),
]

View File

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