Skip to content

Commit 29c6f0c

Browse files
author
Valentijn Scholten
committed
rebase
1 parent 732bfa8 commit 29c6f0c

File tree

1 file changed

+37
-2
lines changed
  • docs/content/en/open_source/upgrading

1 file changed

+37
-2
lines changed

docs/content/en/open_source/upgrading/2.54.md

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,41 @@
22
title: 'Upgrading to DefectDojo Version 2.54.x'
33
toc_hide: true
44
weight: -20251201
5-
description: No special instructions.
5+
description: Removal of django-auditlog and exclusive use of django-pghistory for audit logging.
66
---
7-
There are no special instructions for upgrading to 2.54.x. Check the [Release Notes](https://github.com/DefectDojo/django-DefectDojo/releases/tag/2.54.0) for the contents of the release.
7+
8+
## Breaking Change: Removal of django-auditlog
9+
10+
Starting with DefectDojo 2.53, `django-auditlog` support has been removed in favour of `django-pghistory`.
11+
This is designed to be a backwards compatible change, unless:
12+
- You're querying the database directly for auditlog events, or,
13+
- You've set the `DD_AUDITLOG_TYPE` environment variable (or `AUDITLOG_TYPE` settings field)
14+
15+
### Required Actions
16+
17+
If you're using `DD_AUDITLOG_TYPE`, remove it from your configuration/environment.
18+
19+
### Existing Records Preserved
20+
21+
Historical audit log entries stored in the `auditlog_logentry` table will continue to be displayed in the action history view for backward compatibility. No data migration is required.
22+
23+
### Benefits of django-pghistory
24+
25+
The switch to `django-pghistory` provides several advantages:
26+
27+
- **Better performance**: Database-level triggers reduce overhead compared to Django signal-based auditing
28+
- **More features**: Enhanced context tracking and better support for complex queries
29+
- **Better data integrity**: PostgreSQL-native implementation ensures consistency
30+
31+
### Migration Notes
32+
33+
- A one-time data migration will take place to populate the `django-pghistory` tables with the initial snapshot of the tracked models.
34+
- The migration is designed to be fail-safe: if it fails for some reason, it will continue where it left off.
35+
- The migration can also be performed up front via
36+
- `docker compose exec uwsgi bash -c "python manage.py pghistory_backfill_fast"`, or
37+
- `docker compose exec uwsgi bash -c "python manage.py pghistory_backfill_simple"`, or
38+
- `docker compose exec uwsgi bash -c "python manage.py pghistory_backfill"`
39+
40+
The backfill migration is not mandatory to succeed. If it fails for some reason, the only side effect will be that the first auditlog diff will contain all fields of an object instead just the changed fields.
41+
42+
Check the [Release Notes](https://github.com/DefectDojo/django-DefectDojo/releases/tag/2.54.0) for the contents of the release.

0 commit comments

Comments
 (0)