Repository navigation
Commit cc70928
Say out loud that the restore replays history
I read the restore as full of workarounds — rows inserted in a starting
state, fields left null — and assumed they were dodging triggers, with
some of them quietly losing data. Both readings were wrong.
Announcements go in as drafts, media assets staged, transform claims
reserved, MCP grants unrevoked. Then the transition rows follow, and
the *_apply triggers rebuild the final state from them. The restore
does not copy state; it replays the path production took to reach that
state. Measured: a claim exported as succeeded comes back succeeded,
and a revoked grant comes back revoked with its own reason rather than
the bulk one.
So there is nothing to simplify here. What was missing is that the code
never said any of this, which is how I misread it and how the next
reader would too. That explanation is now at the top of the restore.
Two properties that held only by luck now hold by test. A backup taken
from a restored database has to pass its own verification — otherwise
surviving one disaster leaves you defenceless against the second. And
the transform claims have to come back with the statuses they left
with, since a claim stuck at reserved would contradict the monthly
counts and invalidate the next backup.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 88ceffc commit cc70928
3 files changed
Lines changed: 45 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
1151 | 1152 | | |
1152 | 1153 | | |
1153 | 1154 | | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
1154 | 1160 | | |
1155 | 1161 | | |
1156 | 1162 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
1155 | 1156 | | |
1156 | 1157 | | |
1157 | 1158 | | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
1158 | 1182 | | |
1159 | 1183 | | |
1160 | 1184 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
332 | 347 | | |
333 | 348 | | |
334 | 349 | | |
| |||
0 commit comments