diff --git a/apps/assets/migrations/0003_auto_20180109_2331.py b/apps/assets/migrations/0003_auto_20180109_2331.py index e32b81a3f..5f820c479 100644 --- a/apps/assets/migrations/0003_auto_20180109_2331.py +++ b/apps/assets/migrations/0003_auto_20180109_2331.py @@ -1141,6 +1141,37 @@ platforms_data_json = '''[ } ] }, + { + "category": "database", + "type": "dameng", + "internal": true, + "charset": "utf-8", + "domain_enabled": true, + "su_enabled": false, + "name": "Dameng", + "automation": { + "ansible_enabled": false, + "ansible_config": { + "ansible_connection": "local" + }, + "ping_enabled": false, + "gather_facts_enabled": false, + "gather_accounts_enabled": false, + "verify_account_enabled": false, + "change_secret_enabled": false, + "push_account_enabled": false + }, + "protocols": [ + { + "name": "dameng", + "port": 5236, + "required": false, + "setting": {}, + "primary": True, + "default": false + } + ] + }, { "name": "DB2", "category": "database", diff --git a/apps/assets/migrations/0128_auto_20240514_1521.py b/apps/assets/migrations/0128_auto_20240514_1521.py deleted file mode 100644 index cad8628fa..000000000 --- a/apps/assets/migrations/0128_auto_20240514_1521.py +++ /dev/null @@ -1,31 +0,0 @@ -# Generated by Django 4.1.10 on 2023-10-07 06:37 - -from django.db import migrations - - -def add_dameng_platform(apps, schema_editor): - platform_cls = apps.get_model('assets', 'Platform') - automation_cls = apps.get_model('assets', 'PlatformAutomation') - platform, _ = platform_cls.objects.update_or_create( - name='Dameng', defaults={ - 'name': 'Dameng', 'category': 'database', - 'internal': True, 'type': 'dameng', - 'domain_enabled': True, 'su_enabled': False, - 'su_method': None, 'comment': 'Dameng', 'created_by': 'System', - 'updated_by': 'System', 'custom_fields': [] - } - ) - platform.protocols.update_or_create(name='dameng', defaults={ - 'name': 'dameng', 'port': 5236, 'primary': True, 'setting': {} - }) - automation_cls.objects.update_or_create(platform=platform, defaults={'ansible_enabled': False}) - - -class Migration(migrations.Migration): - dependencies = [ - ('assets', '0127_automation_remove_account'), - ] - - operations = [ - migrations.RunPython(add_dameng_platform) - ]