fix(sql): prevent stale Delete from outranking newer Insert in usp_SyncApply

Route both upsert and delete branches off a single ranked CTE (rn=1 per RecordID over all pending ops ordered by SourceLogID DESC). The previous design used two independent ranked CTEs, which let a stale Delete outrank a newer Insert for the same RecordID and silently drop the row. Also gitignore .claude/ and .workbuddy/ runtime dirs.
This commit is contained in:
Misaka_Company
2026-07-14 15:32:03 +08:00
parent f85d0a71cc
commit b1b118463d
2 changed files with 34 additions and 17 deletions

3
.gitignore vendored
View File

@@ -7,3 +7,6 @@ logs/
config.yaml
config.local.yaml
config.pilot.yaml
.claude/
.workbuddy/