AAP-44233 Create credential types in new migration step (#6969)

* Update database to credential types in new migration file

* bump migration

* Add assertion

* Pre-delete credentials so we test recreation
This commit is contained in:
Alan Rominger
2025-06-11 16:26:42 -04:00
committed by GitHub
parent ee19ee0c10
commit 3d027bafd0
2 changed files with 39 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
from django.db import migrations
# AWX
from awx.main.models import CredentialType
from awx.main.utils.common import set_current_apps
def setup_tower_managed_defaults(apps, schema_editor):
set_current_apps(apps)
CredentialType.setup_tower_managed_defaults(apps)
class Migration(migrations.Migration):
dependencies = [
('main', '0200_template_name_constraint'),
]
operations = [
migrations.RunPython(setup_tower_managed_defaults),
]