2022-06-30 07:48:47 +00:00
|
|
|
# Generated by Django 3.2.13 on 2022-06-30 07:17
|
2022-06-29 13:08:07 +00:00
|
|
|
|
|
|
|
from django.db import migrations
|
|
|
|
from django.utils.translation import gettext_lazy as _
|
|
|
|
|
|
|
|
def add_default_settings(apps, schema_editor):
|
|
|
|
setting = apps.get_model("appsettings", "AppSettings")
|
|
|
|
db_alias = schema_editor.connection.alias
|
|
|
|
setting.objects.using(db_alias).bulk_create([
|
|
|
|
setting(31, _("VM DRBD Status"), "VM_DRBD_STATUS", "False", "True,False", _("Show VM DRBD Status")),
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
def del_default_settings(apps, schema_editor):
|
|
|
|
setting = apps.get_model("appsettings", "AppSettings")
|
|
|
|
db_alias = schema_editor.connection.alias
|
|
|
|
setting.objects.using(db_alias).filter(key="VM_DRBD_STATUS").delete()
|
|
|
|
|
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
|
|
|
|
dependencies = [
|
2022-06-30 07:48:47 +00:00
|
|
|
('appsettings', '0005_auto_20200911_1233'),
|
2022-06-29 13:08:07 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
operations = [
|
2022-09-05 12:38:00 +00:00
|
|
|
migrations.RunPython(add_default_settings, del_default_settings),
|
2022-06-29 13:08:07 +00:00
|
|
|
]
|