perf: add sftplog command models field index

This commit is contained in:
feng
2025-04-21 14:19:29 +08:00
committed by feng626
parent 14a8d877e0
commit f016ae6161
4 changed files with 58 additions and 3 deletions

View File

@@ -0,0 +1,17 @@
# Generated by Django 4.1.13 on 2025-04-21 06:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('terminal', '0006_endpoint_oracle_port'),
]
operations = [
migrations.AddIndex(
model_name='command',
index=models.Index(fields=['timestamp', 'org_id'], name='idx_timestamp_org'),
),
]

View File

@@ -74,3 +74,6 @@ class Command(AbstractSessionCommand):
db_table = "terminal_command"
ordering = ('-timestamp',)
verbose_name = _('Command record')
indexes = [
models.Index(fields=['timestamp', 'org_id'], name='idx_timestamp_org'),
]