Skip to content

Commit

Permalink
Fix SA2.0 ORM usage in model.HistoryAudit.prune()
Browse files Browse the repository at this point in the history
  • Loading branch information
jdavcs committed Sep 29, 2023
1 parent 9072aea commit 9ac3842
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/galaxy/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2838,12 +2838,12 @@ class HistoryAudit(Base, RepresentById):
@classmethod
def prune(cls, sa_session):
latest_subq = (
sa_session.query(cls.history_id, func.max(cls.update_time).label("max_update_time"))
select(cls.history_id, func.max(cls.update_time).label("max_update_time"))
.group_by(cls.history_id)
.subquery()
)
not_latest_query = (
sa_session.query(cls.history_id, cls.update_time)
select(cls.history_id, cls.update_time)
.select_from(latest_subq)
.join(
cls,
Expand Down

0 comments on commit 9ac3842

Please sign in to comment.