mirror of
https://github.com/ansible/awx.git
synced 2026-01-18 13:11:19 -03:30
Merge pull request #10456 from jbradberry/danger-danger-will-robinson
Remove isolated instances and groups SUMMARY before we remove the fields that allow us to correctly identify them. ISSUE TYPE Bugfix Pull Request COMPONENT NAME API Reviewed-by: Alan Rominger <arominge@redhat.com> Reviewed-by: Jeff Bradberry <None> Reviewed-by: Chris Meyers <None>
This commit is contained in:
commit
d4a3143b0e
@ -3,6 +3,16 @@
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
def remove_iso_instances(apps, schema_editor):
|
||||
Instance = apps.get_model('main', 'Instance')
|
||||
Instance.objects.filter(rampart_groups__controller__isnull=False).delete()
|
||||
|
||||
|
||||
def remove_iso_groups(apps, schema_editor):
|
||||
InstanceGroup = apps.get_model('main', 'InstanceGroup')
|
||||
InstanceGroup.objects.filter(controller__isnull=False).delete()
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
@ -10,6 +20,8 @@ class Migration(migrations.Migration):
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(remove_iso_instances),
|
||||
migrations.RunPython(remove_iso_groups),
|
||||
migrations.RemoveField(
|
||||
model_name='instance',
|
||||
name='last_isolated_check',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user