Skip to content

Commit 158084e

Browse files
authored
docs: show the validate_schema upgrade hints (#248)
1 parent 84d9a66 commit 158084e

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

‎docs/usage/schema-validation.md‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,24 @@ For those, the `RuntimeError` ends with a pointer to
6060
[Alembic migrations § Fixing drift autogenerate can't see](../operations/alembic.md#fixing-drift-autogenerate-cant-see),
6161
which holds the hand-written migration recipe.
6262

63+
Two indexes changed shape between releases, so a table migrated on an
64+
older version fails validation after an upgrade until it gets the new
65+
index. For those, the error names the release and links to the upgrade
66+
migration:
67+
68+
```text
69+
Outbox schema mismatch: table 'outbox' missing index over ['queue', 'next_attempt_at', 'id'] (name='outbox_leased_idx', unique=False); a table created before 0.17 needs it in place of outbox_lease_idx: https://faststream-outbox.modern-python.org/operations/alembic/#upgrading-to-017
70+
```
71+
72+
| Missing index | Changed in | Upgrade migration |
73+
| --- | --- | --- |
74+
| `outbox_pending_idx` | 0.15 | [Upgrading to 0.15](../operations/alembic.md#upgrading-to-015) |
75+
| `outbox_leased_idx` | 0.17 | [Upgrading to 0.17](../operations/alembic.md#upgrading-to-017) |
76+
77+
Use the linked migration, not `alembic revision --autogenerate`: it
78+
builds the index without `CONCURRENTLY` and blocks writes for the whole
79+
build.
80+
6381
!!! warning "Server defaults are not checked"
6482
The diff runs with `compare_server_default=False`. Alembic's
6583
server-default comparison is flaky against Postgres' normalized

0 commit comments

Comments
 (0)