fix(gateway): move handoff_state index to DEFERRED_INDEX_SQL
The index references the handoff_state column which is added by _reconcile_columns() on legacy databases. Placing it in SCHEMA_SQL causes 'no such column' errors during schema migration tests because SCHEMA_SQL runs before reconciliation. Move to DEFERRED_INDEX_SQL which runs after _reconcile_columns() — matching the existing pattern used by idx_messages_session_active. Refs: #43504, #40695 (cherry picked from commit 40ecd61d4993754e077a2bdf0c68707cd2add5f4)
This commit is contained in:
parent
0695a6bcec
commit
a23aa4320e
1 changed files with 2 additions and 0 deletions
|
|
@ -740,6 +740,8 @@ CREATE INDEX IF NOT EXISTS idx_sessions_session_key
|
|||
ON sessions(session_key, started_at DESC);
|
||||
CREATE INDEX IF NOT EXISTS idx_sessions_gateway_peer
|
||||
ON sessions(source, user_id, chat_id, chat_type, thread_id, started_at DESC);
|
||||
CREATE INDEX IF NOT EXISTS idx_sessions_handoff_state
|
||||
ON sessions(handoff_state, started_at);
|
||||
"""
|
||||
|
||||
FTS_SQL = """
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue