Provide a migration to drop obsolete Django admin records #11605

Closed
opened 2025-12-29 21:47:32 +01:00 by adam · 1 comment
Owner

Originally created by @jeremystretch on GitHub (Sep 12, 2025).

Originally assigned to: @pheus on GitHub.

Proposed Changes

The Django admin UI was removed in NetBox v4.0, however older installations may still have the old django_admin_log table in place. We should include a migration to drop this table if it exists. (This should probably be done via a raw SQL command to avoid raising an error in case the table has already been dropped.)

Justification

Foreign key constraints may prevent the deletion of a user referenced by an old record in django_admin_log. See #20338 for example.

Originally created by @jeremystretch on GitHub (Sep 12, 2025). Originally assigned to: @pheus on GitHub. ### Proposed Changes The Django admin UI was removed in NetBox v4.0, however older installations may still have the old `django_admin_log` table in place. We should include a migration to drop this table if it exists. (This should probably be done via a raw SQL command to avoid raising an error in case the table has already been dropped.) ### Justification Foreign key constraints may prevent the deletion of a user referenced by an old record in `django_admin_log`. See #20338 for example.
adam added the status: acceptedtype: housekeeping labels 2025-12-29 21:47:32 +01:00
adam closed this issue 2025-12-29 21:47:32 +01:00
Author
Owner

@pheus commented on GitHub (Sep 13, 2025):

I'd like to contribute this. Can you please assign it to me? Thanks

@pheus commented on GitHub (Sep 13, 2025): I'd like to contribute this. Can you please assign it to me? Thanks
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11605