mirror of https://github.com/jumpserver/jumpserver
perf: migrations type length
parent
c80ca5236d
commit
5eeb98b15a
|
@ -5,7 +5,7 @@ from django.db import migrations, models
|
|||
|
||||
def migrate_execution_type(apps, schema_editor):
|
||||
count = 0
|
||||
bulk_size = 100
|
||||
bulk_size = 1000
|
||||
while True:
|
||||
start = time.time()
|
||||
execution_model = apps.get_model('assets', 'AutomationExecution')
|
||||
|
@ -33,7 +33,7 @@ class Migration(migrations.Migration):
|
|||
migrations.AddField(
|
||||
model_name='automationexecution',
|
||||
name='type',
|
||||
field=models.CharField(default='', max_length=16, verbose_name='Type'),
|
||||
field=models.CharField(default='', max_length=32, verbose_name='Type'),
|
||||
),
|
||||
migrations.RunPython(migrate_execution_type)
|
||||
]
|
||||
|
|
|
@ -142,7 +142,7 @@ class AutomationExecution(OrgModelMixin):
|
|||
null=True, verbose_name=_("Date start"), db_index=True
|
||||
)
|
||||
date_finished = models.DateTimeField(null=True, verbose_name=_("Date finished"))
|
||||
type = models.CharField(default='', max_length=16, verbose_name=_("Type"))
|
||||
type = models.CharField(default='', max_length=32, verbose_name=_("Type"))
|
||||
duration = models.DecimalField(default=0, max_digits=10, decimal_places=2, verbose_name=_("Duration"))
|
||||
snapshot = EncryptJsonDictTextField(
|
||||
default=dict, blank=True, null=True, verbose_name=_("Automation snapshot")
|
||||
|
|
Loading…
Reference in New Issue