You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make SQL migrations the single source of the Postgres search schema (#3)
PostgresBackend.Migrate hand-wrote the tsvector column, trigger, and GIN
index that migration 000001 already creates, with a drift (namespace
DEFAULT '' vs 'default'), and it created the pg_trgm extension + trigram
indexes that no production path ever called — so fuzzy search ran without
its indexes in production.
- Move pg_trgm + the trigram indexes into a new migration (000006). A DO
block attempts CREATE EXTENSION and degrades gracefully (indexes only
created when the extension is present) so a missing privilege does not
fail startup. Bump RequiredSchemaVersion to 6.
- Reduce PostgresBackend.Migrate to running the versioned migrations, so
there is one schema definition and it cannot drift.
- Point the Postgres search tests at the real migrations (reset schema +
RunMigrations) instead of AutoMigrate + backend DDL, and adjust the
down-migration step counts and required-version log assertions for v6.
Verified against a live Postgres: migrations create pg_trgm, both trigram
indexes, and namespace DEFAULT 'default'.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
0 commit comments