Closes #20341: Drop legacy django_admin_log table (#20349)
Some checks failed
CI / build (20.x, 3.10) (push) Has been cancelled
CI / build (20.x, 3.11) (push) Has been cancelled
CI / build (20.x, 3.12) (push) Has been cancelled
CodeQL / Analyze (${{ matrix.language }}) (none, actions) (push) Has been cancelled
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Has been cancelled
CodeQL / Analyze (${{ matrix.language }}) (none, python) (push) Has been cancelled

This commit is contained in:
Martin Hauser 2025-09-13 20:11:13 +02:00 committed by GitHub
parent 2a99aadc5d
commit 2dac09cea0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -0,0 +1,22 @@
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0011_concrete_objecttype'),
]
operations = [
# Django admin UI was removed in NetBox v4.0
# Older installations may still have the old `django_admin_log` table in place
# Drop the obsolete table if it exists. This is a no-op on fresh or already-clean DBs.
migrations.RunSQL(
sql='DROP TABLE IF EXISTS "django_admin_log";',
reverse_sql=migrations.RunSQL.noop,
),
# Clean up a potential leftover sequence in older DBs
migrations.RunSQL(
sql='DROP SEQUENCE IF EXISTS "django_admin_log_id_seq";',
reverse_sql=migrations.RunSQL.noop,
),
]