Commit bed427f
* fix(metadata-protocol): ensureOverlayIndex probes before it drops, and reports what it could not enforce (#6418)
`sys_metadata`'s overlay-uniqueness migration ran DROP-then-CREATE with nothing
restoring the dropped index and both catch blocks empty, so on SQLite/PostgreSQL
a CREATE that failed on existing rows left the table with no unique index at all
and no line in the log. The degradation branch only fired on
/partial|where clause|syntax/i, which duplicate-row errors never match.
The order is now probe-first — build under a throwaway name, and only once that
has succeeded drop the real name and rebuild it — extracted into a shared
partial-index-probe.ts that view-definition-active-index.ts also uses (its
behaviour and tests are unchanged). Both overlay sections (active and draft) get
the treatment, independently. The empty catches are replaced by ADR-0120 D4's
disposition: keep the previous index, name the unenforced key, ship the
duplicate-listing query, point at `os migrate plan`, never block boot.
The key spelling is byte-identical and the dialect fallback stays non-UNIQUE (an
active row and a draft row for one key legitimately coexist).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W6bLax4KMrSfnE1ydFU8Dw
* fix(metadata-protocol): drop the unused dropIndexQuietly import (#6418)
The type-check debt ratchet caught it: 64 vs the recorded 63. `overlay-index.ts`
issues no drops of its own — `probeThenReplaceIndex` owns them all, and the
dialect fallback is deliberately additive.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W6bLax4KMrSfnE1ydFU8Dw
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent f6cd635 commit bed427f
7 files changed
Lines changed: 1391 additions & 164 deletions
File tree
- .changeset
- packages/metadata-protocol/src
- migrations
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
Lines changed: 529 additions & 0 deletions
Large diffs are not rendered by default.
0 commit comments