Skip to content

Commit a8f0c95

Browse files
committed
fix migration
1 parent 89f6ca2 commit a8f0c95

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

netbox_custom_objects/migrations/0002_ensure_fk_constraints.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ def ensure_existing_fk_constraints(apps, schema_editor):
1212
on individual fields rather than all fields, and this migration ensures existing
1313
fields have proper CASCADE constraints.
1414
"""
15-
CustomObjectType = apps.get_model('netbox_custom_objects', 'CustomObjectType')
15+
# Import the actual model class (not the historical version) to access methods
16+
from netbox_custom_objects.models import CustomObjectType
1617

1718
for custom_object_type in CustomObjectType.objects.all():
1819
try:

0 commit comments

Comments
 (0)