Repository navigation
fix(postgres): the migration check reads the tracker of the configured schema only - #2257
Conversation
…d schema only With `LAKEKEEPER__PG_SCHEMA` set, the search_path is `<schema>, public`. If the configured schema exists but holds no `_sqlx_migrations`, the unqualified tracker name resolved to `public._sqlx_migrations`, so a second install in `public` made the check report `Complete` and `serve` / `wait-for-db -dm` start against `public`'s tables. The check now reports `NoMigrationsTable` when the configured schema has no tracker of its own.
|
No actionable comments were generated in the recent review. WalkthroughThe migration status check now verifies that the configured current schema has its own core migration tracker. A regression test checks the result when only ChangesMigration status check
Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk:
|
With
LAKEKEEPER__PG_SCHEMAset, the start-up migration check ofserveandwait-for-db -dmnow reads the migration tracker of that schema only. Connections usesearch_path = <schema>, public, so for a schema without a tracker the check could read the tracker of an installation inpublicand report the database as migrated. It now reports the schema as not migrated, andwait-for-dbwaits formigrate.migratealready creates the tracker in the configured schema and is unchanged.LAKEKEEPER__PG_SCHEMAare unchanged.publicis not migrated, and is migrated aftermigrate.Release notes
Bug Fixes
LAKEKEEPER__PG_SCHEMAset,serveandwait-for-dbcheck the migrations of that schema only, also whenpublicholds another installation.Summary by CodeRabbit