mirror of
https://github.com/ansible/awx.git
synced 2026-02-15 02:00:01 -03:30
Fix migration failure for 0200 (#16135)
Moved the AddField operation before the RunPython operations for 'rename_jts' and 'rename_projects' in migration 0200_template_name_constraint.py. This ensures the new 'org_unique' field exists before related data migrations are executed. Fix ``` django.db.utils.ProgrammingError: column main_unifiedjobtemplate.org_unique does not exist ``` while applying migration 0200_template_name_constraint.py when there's a job template or poject with duplicate name in the same org
This commit is contained in:
@@ -38,13 +38,13 @@ class Migration(migrations.Migration):
|
|||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
migrations.RunPython(rename_jts, migrations.RunPython.noop),
|
|
||||||
migrations.RunPython(rename_projects, migrations.RunPython.noop),
|
|
||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name='unifiedjobtemplate',
|
model_name='unifiedjobtemplate',
|
||||||
name='org_unique',
|
name='org_unique',
|
||||||
field=models.BooleanField(blank=True, default=True, editable=False, help_text='Used internally to selectively enforce database constraint on name'),
|
field=models.BooleanField(blank=True, default=True, editable=False, help_text='Used internally to selectively enforce database constraint on name'),
|
||||||
),
|
),
|
||||||
|
migrations.RunPython(rename_jts, migrations.RunPython.noop),
|
||||||
|
migrations.RunPython(rename_projects, migrations.RunPython.noop),
|
||||||
migrations.RunPython(rename_wfjt, migrations.RunPython.noop),
|
migrations.RunPython(rename_wfjt, migrations.RunPython.noop),
|
||||||
migrations.RunPython(change_inventory_source_org_unique, migrations.RunPython.noop),
|
migrations.RunPython(change_inventory_source_org_unique, migrations.RunPython.noop),
|
||||||
migrations.AddConstraint(
|
migrations.AddConstraint(
|
||||||
|
|||||||
Reference in New Issue
Block a user