From d57f52ee243392e866bb45e7f23634d9c1452dd3 Mon Sep 17 00:00:00 2001 From: ibuler Date: Tue, 2 Nov 2021 20:08:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=20window=20RDP=20TLS?= =?UTF-8?q?=20=E5=B9=B3=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migrations/0079_auto_20211102_1922.py | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 apps/assets/migrations/0079_auto_20211102_1922.py diff --git a/apps/assets/migrations/0079_auto_20211102_1922.py b/apps/assets/migrations/0079_auto_20211102_1922.py new file mode 100644 index 000000000..64f4124f3 --- /dev/null +++ b/apps/assets/migrations/0079_auto_20211102_1922.py @@ -0,0 +1,28 @@ +# Generated by Django 3.1.12 on 2021-11-02 11:22 + +from django.db import migrations + + +def create_internal_platform(apps, schema_editor): + model = apps.get_model("assets", "Platform") + db_alias = schema_editor.connection.alias + type_platforms = ( + ('Windows-RDP', 'Windows', {'security': 'rdp'}), + ('Windows-TLS', 'Windows', {'security': 'tls'}), + ) + for name, base, meta in type_platforms: + defaults = {'name': name, 'base': base, 'meta': meta} + model.objects.using(db_alias).update_or_create( + name=name, defaults=defaults + ) + + +class Migration(migrations.Migration): + + dependencies = [ + ('assets', '0078_auto_20211014_2209'), + ] + + operations = [ + migrations.RunPython(create_internal_platform) + ]