mirror of https://github.com/jumpserver/jumpserver
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
660 B
21 lines
660 B
# Generated by Django 4.1.10 on 2023-09-13 10:59
|
|
|
|
from django.db import migrations
|
|
|
|
|
|
def migrate_device_automation_ansible_enabled(apps, *args):
|
|
platform_model = apps.get_model('assets', 'Platform')
|
|
automation_model = apps.get_model('assets', 'PlatformAutomation')
|
|
ids = platform_model.objects.filter(category='device').values_list('id', flat=True)
|
|
automation_model.objects.filter(platform_id__in=ids).update(ansible_enabled=True)
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
dependencies = [
|
|
('assets', '0122_auto_20230803_1553'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.RunPython(migrate_device_automation_ansible_enabled)
|
|
]
|