Commit 3fe0fe7
committed
fix(worker): populate forwarder_sent.audit_log_id for UUID-shaped audit_ids (mig 072)
Companion to api mig 072 (forwarder_sent.audit_log_id UUID FK column).
markSent now includes audit_log_id in the INSERT column list and populates
it via an inline CASE expression:
CASE WHEN $1 ~* '^[0-9a-f]{8}-...-[0-9a-f]{12}$'
THEN $1::uuid
ELSE NULL
END
This means:
- Real UUID audit_ids (post-mig-063 rows from audit_log-backed emitters)
→ audit_log_id set; the orphan-reconciler can JOIN on the typed UUID column
instead of scanning with a regex over TEXT.
- Placeholder IDs ("reminder-<resource_id>-<stage>", "provider-<grace_id>")
→ audit_log_id stays NULL; no behaviour change for those legacy emitters.
Test update: TestForwarder_LedgerClaim_AllColumnsRoundtripThroughInsert
updated to match the new column list + CASE expression in the INSERT regex.1 parent e7d23c6 commit 3fe0fe7
2 files changed
Lines changed: 18 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
252 | 257 | | |
253 | 258 | | |
254 | | - | |
255 | | - | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
256 | 267 | | |
257 | 268 | | |
258 | 269 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
938 | 938 | | |
939 | 939 | | |
940 | 940 | | |
941 | | - | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
942 | 946 | | |
943 | 947 | | |
944 | 948 | | |
| |||
0 commit comments