mirror of
https://github.com/ansible/awx.git
synced 2026-05-20 07:17:40 -02:30
Make the isolated removal migration non-atomic
We are apparently running into problems with pending triggers under some circumstances.
This commit is contained in:
committed by
Shane McDonald
parent
7510b243bb
commit
493e6cc527
@@ -1,19 +1,22 @@
|
|||||||
# Generated by Django 2.2.16 on 2021-04-21 15:02
|
# Generated by Django 2.2.16 on 2021-04-21 15:02
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models, transaction
|
||||||
|
|
||||||
|
|
||||||
def remove_iso_instances(apps, schema_editor):
|
def remove_iso_instances(apps, schema_editor):
|
||||||
Instance = apps.get_model('main', 'Instance')
|
Instance = apps.get_model('main', 'Instance')
|
||||||
Instance.objects.filter(rampart_groups__controller__isnull=False).delete()
|
with transaction.atomic():
|
||||||
|
Instance.objects.filter(rampart_groups__controller__isnull=False).delete()
|
||||||
|
|
||||||
|
|
||||||
def remove_iso_groups(apps, schema_editor):
|
def remove_iso_groups(apps, schema_editor):
|
||||||
InstanceGroup = apps.get_model('main', 'InstanceGroup')
|
InstanceGroup = apps.get_model('main', 'InstanceGroup')
|
||||||
InstanceGroup.objects.filter(controller__isnull=False).delete()
|
with transaction.atomic():
|
||||||
|
InstanceGroup.objects.filter(controller__isnull=False).delete()
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
atomic = False
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('main', '0138_custom_inventory_scripts_removal'),
|
('main', '0138_custom_inventory_scripts_removal'),
|
||||||
|
|||||||
Reference in New Issue
Block a user