From ea6524f79eb2624e7dcc984b4263cfc2857c32ac Mon Sep 17 00:00:00 2001 From: catborise Date: Mon, 5 Sep 2022 15:39:41 +0300 Subject: [PATCH] add more default machine type and instance type --- .../migrations/0007_auto_20220905_0918.py | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 appsettings/migrations/0007_auto_20220905_0918.py diff --git a/appsettings/migrations/0007_auto_20220905_0918.py b/appsettings/migrations/0007_auto_20220905_0918.py new file mode 100644 index 0000000..229e1cb --- /dev/null +++ b/appsettings/migrations/0007_auto_20220905_0918.py @@ -0,0 +1,21 @@ +# Generated by Django 3.2.13 on 2022-06-30 07:17 + +from django.db import migrations +from django.utils.translation import gettext_lazy as _ + +def update_default_settings(apps, schema_editor): + setting = apps.get_model("appsettings", "AppSettings") + db_alias = schema_editor.connection.alias + setting.objects.using(db_alias).filter(key="INSTANCE_MACHINE_DEFAULT_TYPE").update(choices="q35,x86_64,virt"), + setting.objects.using(db_alias).filter(key="INSTANCE_ARCH_DEFAULT_TYPE").update(choices="x86_64,i686,aarch64"), + + +class Migration(migrations.Migration): + + dependencies = [ + ('appsettings', '0006_auto_20220630_0717'), + ] + + operations = [ + migrations.RunPython(update_default_settings, None) + ]