mirror of https://github.com/jumpserver/jumpserver
perf: 去掉 _autmoation_id
parent
20e7efcd70
commit
024d344f7e
|
@ -24,12 +24,6 @@ def migrate_automation_platform(apps, schema_editor):
|
|||
automation.save(update_fields=['platform'])
|
||||
|
||||
|
||||
def migrate_null_platform_automation(apps, schema_editor):
|
||||
automation_model = apps.get_model('assets', 'PlatformAutomation')
|
||||
null_platform_automations = automation_model.objects.filter(platform__isnull=True)
|
||||
null_platform_automations.delete()
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
('assets', '0114_baseautomation_params'),
|
||||
|
@ -50,4 +44,5 @@ class Migration(migrations.Migration):
|
|||
related_name='automation', to='assets.platform'),
|
||||
),
|
||||
migrations.RunPython(migrate_automation_platform),
|
||||
migrations.RemoveField(model_name='platform', name='_automation_id'),
|
||||
]
|
||||
|
|
|
@ -101,7 +101,6 @@ class Platform(JMSBaseModel):
|
|||
su_enabled = models.BooleanField(default=False, verbose_name=_("Su enabled"))
|
||||
su_method = models.CharField(max_length=32, blank=True, null=True, verbose_name=_("Su method"))
|
||||
custom_fields = models.JSONField(null=True, default=list, verbose_name=_("Custom fields"))
|
||||
_automation_id = models.UUIDField(null=True, editable=False)
|
||||
|
||||
@property
|
||||
def type_constraints(self):
|
||||
|
|
Loading…
Reference in New Issue