Commit 5105e03
committed
feat(storage): add V2 migration with index adjustments
Drops indexes that duplicate primary keys on `occurrences` and `snapshots`
(audit #10), adds composite `workitems(enactment_id, state)` covering the
`list_live_workitems` query (audit #4), and adds indexes for two FK columns
that were missing them: `enactments(flow_id)` (audit #8) and
`workitem_logs(workitem_id)` (audit #9). The single-column `workitems(state)`
index is preserved because `WorkitemStream.live_query/1` issues a bare
`state in [...]` query without an `enactment_id` filter, which the composite
cannot serve as a left prefix.1 parent 004a5d3 commit 5105e03
2 files changed
Lines changed: 40 additions & 1 deletion
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
0 commit comments