Skip to content

fix(cli): auto-migrate on fts:rebuild + optimize (2.2.1)#60

Merged
bigin merged 1 commit into
mainfrom
fix/cli-auto-migrate
May 17, 2026
Merged

fix(cli): auto-migrate on fts:rebuild + optimize (2.2.1)#60
bigin merged 1 commit into
mainfrom
fix/cli-auto-migrate

Conversation

@bigin

@bigin bigin commented May 17, 2026

Copy link
Copy Markdown
Owner

The 2.2.0 upgrade recipe said to run vendor/bin/imanager fts:rebuild after composer update, but the command opened a raw PDO without running pending migrations. The rebuild fired against the pre-2.2.0 schema (fields.searchable=0 everywhere) and silently produced an empty FTS body for every item. Caught while bumping Scriptor's composer.lock — fixed before reaching the Hetzner demo.

DatabaseFactory::migrateIfNeeded() is the new shared primitive: announces each pending migration via the command's output, then applies. Called from FtsRebuildCommand and OptimizeCommand. Diagnostic commands (dump, repair, schema:status) are deliberately left alone — they must report on the on-disk state, not a post-migration state.

CHANGELOG 2.2.0 upgrade block carries a visible 2.2.1 correction note so anyone reading the published Keep-a-Changelog entry sees the issue, rather than the entry being silently edited.

VERSION 2.2.0 -> 2.2.1; ReleaseConsistencyTest enforces match.

The 2.2.0 upgrade recipe said to run `vendor/bin/imanager fts:rebuild`
after `composer update`, but the command opened a raw PDO without
running pending migrations. The rebuild fired against the pre-2.2.0
schema (fields.searchable=0 everywhere) and silently produced an
empty FTS body for every item. Caught while bumping Scriptor's
composer.lock — fixed before reaching the Hetzner demo.

DatabaseFactory::migrateIfNeeded() is the new shared primitive:
announces each pending migration via the command's output, then
applies. Called from FtsRebuildCommand and OptimizeCommand.
Diagnostic commands (dump, repair, schema:status) are deliberately
left alone — they must report on the on-disk state, not a
post-migration state.

CHANGELOG 2.2.0 upgrade block carries a visible 2.2.1 correction
note so anyone reading the published Keep-a-Changelog entry sees
the issue, rather than the entry being silently edited.

VERSION 2.2.0 -> 2.2.1; ReleaseConsistencyTest enforces match.
@bigin bigin merged commit 958025e into main May 17, 2026
4 checks passed
@bigin bigin deleted the fix/cli-auto-migrate branch May 17, 2026 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant