Files
awx/awx/main/migrations/0139_isolated_removal.py
Jeff Bradberry 15fd22681d Revert removing the old isolated groups
In 4.1+ / AAP 2.1+, isolated groups should be converted into plain
instance groups, and it's desirable for the old ones to stick around
since they'll likely be tied to a bunch of job templates.  We do not
want to make the users have to reconstruct those relationships.
2021-10-08 11:53:21 -04:00

35 lines
1.0 KiB
Python

# Generated by Django 2.2.16 on 2021-04-21 15:02
from django.db import migrations, models, transaction
def remove_iso_instances(apps, schema_editor):
Instance = apps.get_model('main', 'Instance')
with transaction.atomic():
Instance.objects.filter(rampart_groups__controller__isnull=False).delete()
class Migration(migrations.Migration):
atomic = False
dependencies = [
('main', '0138_custom_inventory_scripts_removal'),
]
operations = [
migrations.RunPython(remove_iso_instances),
migrations.RemoveField(
model_name='instance',
name='last_isolated_check',
),
migrations.RemoveField(
model_name='instancegroup',
name='controller',
),
migrations.AlterField(
model_name='unifiedjob',
name='controller_node',
field=models.TextField(blank=True, default='', editable=False, help_text='The instance that managed the execution environment.'),
),
]