From 93ba4443ddf96e0a9714f4704a7079c594903e66 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Tue, 1 Aug 2023 19:48:32 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20windows=20ssh=20=E5=8D=8F=E8=AE=AE=20?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=BC=80=E5=90=AF=20(#11158)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: feng <1304903146@qq.com> --- .../migrations/0122_auto_20230801_1940.py | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 apps/assets/migrations/0122_auto_20230801_1940.py diff --git a/apps/assets/migrations/0122_auto_20230801_1940.py b/apps/assets/migrations/0122_auto_20230801_1940.py new file mode 100644 index 000000000..3197ffec3 --- /dev/null +++ b/apps/assets/migrations/0122_auto_20230801_1940.py @@ -0,0 +1,24 @@ +# Generated by Django 4.1.10 on 2023-08-01 11:40 + +from django.db import migrations + + +def windows_platform_protocols_ssh_default(apps, schema_editor): + platform_cls = apps.get_model('assets', 'Platform') + windows_platform = platform_cls.objects.filter( + name='Windows', internal=True, type='windows' + ).first() + if not windows_platform: + return + + windows_platform.protocols.filter(name='ssh').update(default=True) + + +class Migration(migrations.Migration): + dependencies = [ + ('assets', '0121_auto_20230725_1458'), + ] + + operations = [ + migrations.RunPython(windows_platform_protocols_ssh_default) + ]