fix(core): commit generated migration for session directory index - #240
alltomatos wants to merge 4 commits into
Conversation
perf(core) commit 5372b2e added a composite index declaration (session_directory_time_created_id_idx on directory, time_created, id) to packages/core/src/session/sql.ts but never ran the migration generator, so the declared schema and the committed migration/snapshot diverged. unit (linux)/unit (windows) on dev have been red ever since (DatabaseMigration > declared schema has no ungenerated migrations), blocking CI on every PR regardless of what it touches. Ran `bun script/migration.ts` from packages/core (the tool the check's own error message points to) to generate the missing migration file and regenerate schema.json/schema.gen.ts/migration.gen.ts -- no manual edits to any generated file. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015KrFrdVEmx7apnofWUViJw
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015KrFrdVEmx7apnofWUViJw
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015KrFrdVEmx7apnofWUViJw
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015KrFrdVEmx7apnofWUViJw
|
Generated by Claude Code |
|
Generated by Claude Code |
…ened first) My earlier commit generated a migration with a different random id for the same session_directory_time_created_id_idx index that #240 (opened ~10h earlier) already added. Removing mine and using #240's exact migration/schema files instead, so this PR's ported fix aligns with whichever one actually merges into dev. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SHQKcGH7ayRe8UHJ9CAPQJ
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SHQKcGH7ayRe8UHJ9CAPQJ
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SHQKcGH7ayRe8UHJ9CAPQJ
Use the same schema id/prevIds as PR #240's session_directory_time_created_id_idx migration to avoid two divergent migration histories for the same index.
Previous commit had a transcription error (table: session instead of table: todo) and a missing trailing newline vs PR #240's canonical file.
Issue for this PR
Closes #239
Type of change
What does this PR do?
unit (linux)andunit (windows)are currently red ondevitself, blocking CI on every open PR (including #234 and #237) fromtest/database-migration.test.ts> "declared schema has no ungenerated migrations".Root cause:
perf(core): add composite index on session(directory, time_created, id) (closes #229)(commit5372b2ed3f) added an index declaration topackages/core/src/session/sql.tsbut never ran the migration generator, so the declared Drizzle schema and the committed migration/snapshot diverged.Fix: ran
bun script/migration.tsfrompackages/core(the tool the check's own error message points to) — no manual edits to any generated file. This adds the missing migration file and regeneratesschema.json,schema.gen.ts, andmigration.gen.ts.How did you verify your code works?
bun script/migration.ts --checkfrompackages/corenow exits 0 (was exiting 1 before this fix, reproduced againstdev's actual head).bun test test/database-migration.test.ts→ 16 pass, 0 fail (was 1 fail before the fix).Screenshots / recordings
N/A — generated migration/schema files only, no behavior change beyond what commit 5372b2e already declared.
Checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_015KrFrdVEmx7apnofWUViJw
Generated by Claude Code