mirror of https://github.com/jumpserver/jumpserver
perf: 优化 ftp log 索引
parent
38601a84c2
commit
23723f4eda
|
@ -0,0 +1,29 @@
|
|||
# Generated by Django 4.1.10 on 2023-09-06 05:31
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.utils.timezone
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('audits', '0022_auto_20230605_1555'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='ftplog',
|
||||
name='date_start',
|
||||
field=models.DateTimeField(auto_now_add=True, db_index=True, verbose_name='Date start'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='operatelog',
|
||||
name='action',
|
||||
field=models.CharField(choices=[('view', 'View'), ('update', 'Update'), ('delete', 'Delete'), ('create', 'Create'), ('download', 'Download'), ('connect', 'Connect'), ('login', 'Login'), ('change_password', 'Change password')], max_length=16, verbose_name='Action'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='userloginlog',
|
||||
name='datetime',
|
||||
field=models.DateTimeField(db_index=True, default=django.utils.timezone.now, verbose_name='Date login'),
|
||||
),
|
||||
]
|
|
@ -57,7 +57,7 @@ class FTPLog(OrgModelMixin):
|
|||
)
|
||||
filename = models.CharField(max_length=1024, verbose_name=_("Filename"))
|
||||
is_success = models.BooleanField(default=True, verbose_name=_("Success"))
|
||||
date_start = models.DateTimeField(auto_now_add=True, verbose_name=_("Date start"))
|
||||
date_start = models.DateTimeField(auto_now_add=True, verbose_name=_("Date start"), db_index=True)
|
||||
has_file = models.BooleanField(default=False, verbose_name=_("File"))
|
||||
session = models.CharField(max_length=36, verbose_name=_("Session"), default=uuid.uuid4)
|
||||
|
||||
|
@ -198,7 +198,7 @@ class UserLoginLog(models.Model):
|
|||
choices=LoginStatusChoices.choices,
|
||||
verbose_name=_("Status"),
|
||||
)
|
||||
datetime = models.DateTimeField(default=timezone.now, verbose_name=_("Date login"))
|
||||
datetime = models.DateTimeField(default=timezone.now, verbose_name=_("Date login"), db_index=True)
|
||||
backend = models.CharField(
|
||||
max_length=32, default="", verbose_name=_("Authentication backend")
|
||||
)
|
||||
|
|
|
@ -27,7 +27,7 @@ class Applet(JMSBaseModel):
|
|||
web = 'web', _('Web')
|
||||
|
||||
class Edition(models.TextChoices):
|
||||
community = 'community', _('Community Edition')
|
||||
community = 'community', _('Community')
|
||||
enterprise = 'enterprise', _('Enterprise')
|
||||
|
||||
name = models.SlugField(max_length=128, verbose_name=_('Name'), unique=True)
|
||||
|
|
Loading…
Reference in New Issue