mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 09:27:36 -02:30
use existing version of Instance
* Without this change, future modifications to the Instance object may result in migration fails (i.e. adding a field to the Instance model)
This commit is contained in:
@@ -3,10 +3,9 @@ from uuid import uuid4
|
|||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
|
|
||||||
from awx.main.models import Instance
|
|
||||||
|
|
||||||
|
|
||||||
def _generate_new_uuid_for_iso_nodes(apps, schema_editor):
|
def _generate_new_uuid_for_iso_nodes(apps, schema_editor):
|
||||||
|
Instance = apps.get_model('main', 'Instance')
|
||||||
for instance in Instance.objects.all():
|
for instance in Instance.objects.all():
|
||||||
if instance.is_isolated():
|
if instance.is_isolated():
|
||||||
instance.uuid = str(uuid4())
|
instance.uuid = str(uuid4())
|
||||||
|
|||||||
Reference in New Issue
Block a user