Fixes #15695: Clear any legacy group permission associations during migration

This commit is contained in:
Jeremy Stretch 2024-04-16 08:10:36 -04:00
parent 4562e347fd
commit 2a8876846f
1 changed files with 5 additions and 0 deletions

View File

@ -63,6 +63,11 @@ class Migration(migrations.Migration):
field=models.ManyToManyField(blank=True, related_name='object_permissions', to='users.group'),
),
# Delete any lingering group assignments for legacy permissions (from before NetBox v2.9)
migrations.RunSQL(
"DELETE from auth_group_permissions"
),
# Delete groups from the old table
migrations.RunSQL(
"DELETE from auth_group"