Skip to content

Commit 45ce57b

Browse files
stephan0hStephan Herschelwesleykendall
authored
enclosed event table with double quotes (#226)
* enclosed event table with double quotes * Update CHANGELOG.md * Update pyproject.toml --------- Co-authored-by: Stephan Herschel <[email protected]> Co-authored-by: Wes Kendall <[email protected]>
1 parent f516763 commit 45ce57b

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## 3.8.1 (2025-08-30)
4+
5+
#### Fixes
6+
- Ensure mixed-case table names work with event proxy models by [stephan0h](https://github.com/stephan0h) in [#226](https://github.com/AmbitionEng/django-pghistory/pull/226).
7+
38
## 3.8.0 (2025-08-16)
49

510
#### Improvements

pghistory/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ def _get_select(self, event_model):
460460
event_table = event_model._meta.db_table
461461
prev_data_clause = f"""
462462
(
463-
SELECT row_to_json(_prev_event) FROM {event_table} _prev_event
463+
SELECT row_to_json(_prev_event) FROM "{event_table}" _prev_event
464464
WHERE _prev_event.pgh_obj_id = _event.pgh_obj_id
465465
AND _prev_event.pgh_id < _event.pgh_id
466466
ORDER BY _prev_event.pgh_id DESC LIMIT 1
@@ -520,7 +520,7 @@ def _get_select(self, event_model):
520520
{context_id_column_clause},
521521
{context_column_clause},
522522
{pgh_obj_id_column_clause}
523-
FROM {event_table} _event
523+
FROM "{event_table}" _event
524524
{context_join_clause}
525525
{where_clause}
526526
ORDER BY _event.pgh_id

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ packages = [
3030
exclude = [
3131
"*/tests/"
3232
]
33-
version = "3.8.0"
33+
version = "3.8.1"
3434
description = "History tracking for Django and Postgres"
3535
authors = ["Wes Kendall"]
3636
classifiers = [

0 commit comments

Comments
 (0)