fix(kanban): create additive-column indexes after migration#28741
Closed
stormhierta wants to merge 1 commit into
Closed
fix(kanban): create additive-column indexes after migration#28741stormhierta wants to merge 1 commit into
stormhierta wants to merge 1 commit into
Conversation
Collaborator
This was referenced May 19, 2026
Collaborator
|
Thanks @stormhierta — closing as duplicate of #28781, which combined all six community PRs that hit this bug on 2026-05-19 into one salvage (merged in 7552e0f). You correctly diagnosed the SCHEMA_SQL-before-migration ordering issue. The salvage extends coverage to all four additive-column indexes ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SCHEMA_SQLidx_tasks_session_idandidx_events_runafter their columns are guaranteed to exist in_migrate_add_optional_columnsBug
Existing Kanban boards can fail during
connect()with:The
session_idfeature addedtasks.session_idas an additive column, butSCHEMA_SQLalso attempted to createidx_tasks_session_id ON tasks(session_id)before the additive migration ran. On an existing DB,CREATE TABLE IF NOT EXISTS tasks (...)is a no-op, so the old table still lackssession_idwhen the index statement executes.idx_events_run ON task_events(run_id, id)had the same migration-order hazard for legacy boards missingtask_events.run_id.Fix
Keep additive-column indexes out of the global schema script and create them after the additive column migration has run.
Test Plan
/home/stormhierta/.hermes/hermes-agent/venv/bin/python -m pytest tests/hermes_cli/test_kanban_db_init.py -q