Skip to content

Commit

Permalink
Merge pull request #5275 from unisonweb/cp/fix-reflog-sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
aryairani authored Aug 12, 2024
2 parents d5d9d9d + fce96a5 commit 2187b2e
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions codebase2/codebase-sqlite/U/Codebase/Sqlite/Queries.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3500,7 +3500,11 @@ getProjectReflog numEntries projectId =
SELECT project_id, project_branch_id, time, from_root_causal_id, to_root_causal_id, reason
FROM project_branch_reflog
WHERE project_id = :projectId
ORDER BY time DESC
ORDER BY
time DESC,
-- Strictly for breaking ties in transcripts with the same time,
-- this will break ties in the correct order, sorting later inserted rows first.
ROWID DESC
LIMIT :numEntries
|]

Expand All @@ -3512,7 +3516,11 @@ getProjectBranchReflog numEntries projectBranchId =
SELECT project_id, project_branch_id, time, from_root_causal_id, to_root_causal_id, reason
FROM project_branch_reflog
WHERE project_branch_id = :projectBranchId
ORDER BY time DESC
ORDER BY
time DESC,
-- Strictly for breaking ties in transcripts with the same time,
-- this will break ties in the correct order, sorting later inserted rows first.
ROWID DESC
LIMIT :numEntries
|]

Expand All @@ -3523,7 +3531,11 @@ getGlobalReflog numEntries =
[sql|
SELECT project_id, project_branch_id, time, from_root_causal_id, to_root_causal_id, reason
FROM project_branch_reflog
ORDER BY time DESC
ORDER BY
time DESC,
-- Strictly for breaking ties in transcripts with the same time,
-- this will break ties in the correct order, sorting later inserted rows first.
ROWID DESC
LIMIT :numEntries
|]

Expand Down

0 comments on commit 2187b2e

Please sign in to comment.