Skip to content

Commit

Permalink
make it more obvious that the ignore data params are the same in the …
Browse files Browse the repository at this point in the history
…query
  • Loading branch information
hahn-kev committed Oct 7, 2024
1 parent 74e5b2e commit 39204db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/SIL.Harmony/Db/CrdtRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public IQueryable<Commit> CurrentCommits()

public IQueryable<ObjectSnapshot> CurrentSnapshots()
{
//todo this does not respect ignoreChangesAfter
var ignoreDate = ignoreChangesAfter?.UtcDateTime;
return _dbContext.Snapshots.FromSql(
$"""
WITH LatestSnapshots AS (SELECT first_value(s1.Id)
Expand All @@ -68,7 +68,7 @@ PARTITION BY "s1"."EntityId"
) AS "LatestSnapshotId"
FROM "Snapshots" AS "s1"
INNER JOIN "Commits" AS "c" ON "s1"."CommitId" = "c"."Id"
WHERE "c"."DateTime" < {ignoreChangesAfter?.UtcDateTime} OR {ignoreChangesAfter} IS NULL)
WHERE "c"."DateTime" < {ignoreDate} OR {ignoreDate} IS NULL)
SELECT *
FROM "Snapshots" AS "s"
INNER JOIN LatestSnapshots AS "ls" ON "s"."Id" = "ls"."LatestSnapshotId"
Expand Down

0 comments on commit 39204db

Please sign in to comment.