jumpserver/apps/assets/migrations/0124_auto_20231007_1437.py

27 lines
841 B
Python

# Generated by Django 4.1.10 on 2023-10-07 06:37
from django.db import migrations
def add_db2_platform(apps, schema_editor):
platform_cls = apps.get_model('assets', 'Platform')
automation_cls = apps.get_model('assets', 'PlatformAutomation')
platform = platform_cls.objects.create(
name='DB2', internal=True, category='database', type='db2',
domain_enabled=True, su_enabled=False, comment='DB2',
created_by='System', updated_by='System',
)
platform.protocols.create(name='db2', port=5000, primary=True, setting={})
automation_cls.objects.create(ansible_enabled=False, platform=platform)
class Migration(migrations.Migration):
dependencies = [
('assets', '0123_device_automation_ansible_enabled'),
]
operations = [
migrations.RunPython(add_db2_platform)
]