Skip to content

fix(core): commit generated migration for session directory index - #244

Closed
alltomatos wants to merge 8 commits into
devfrom
fix/core-session-index-migration
Closed

alltomatos wants to merge 8 commits into
devfrom
fix/core-session-index-migration

Conversation

@alltomatos

Copy link
Copy Markdown
Owner

Issue for this PR

Closes #243

Type of change

  • Bug fix

What does this PR do?

unit (linux) is red on dev itself: the "declared schema has no ungenerated migrations" check in packages/core/test/database-migration.test.ts fails because session_directory_time_created_id_idx is already declared in packages/core/src/database/schema.ts, but its generated migration (schema.json, schema.gen.ts, migration.gen.ts, and the migration file itself) was never committed.

Reproduced locally on a clean dev checkout: bun test test/database-migration.test.ts fails with "Core schema has ungenerated database migrations." Ran bun script/migration.ts from packages/core to generate the missing migration — the diff is purely the new index's generated migration entry, nothing else changed.

How did you verify your code works?

  • bun test test/database-migration.test.ts from packages/core: 16 pass, 0 fail (was 1 fail before this fix).
  • Full packages/core test suite: 1135 pass; 2 pre-existing failures in util.flock/util.effect-flock are unrelated to this change (caused by running the tests as root in this sandbox).
  • Each pushed file's blob SHA was verified byte-for-byte against the locally-generated, tested file (this sandbox can't run a local git push, so every commit here went through the GitHub API — see PR fix(provider): complete Bedrock ARN/DeepSeek and SSE reader-cancel upstream ports #241 for why).

Screenshots / recordings

N/A — generated database migration files, no UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

This PR was opened by an unattended scheduled sync run — please review before merging.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SHQKcGH7ayRe8UHJ9CAPQJ


Generated by Claude Code

alltomatos and others added 5 commits September 15, 2026 09:52
`unit (linux)` is red on `dev` itself: the "declared schema has no
ungenerated migrations" check fails because `session_directory_time_created_id_idx`
is already declared in the schema source but its generated migration
(schema.json/schema.gen.ts/migration.gen.ts + the migration file
itself) was never committed on this branch.

Reproduced locally: `bun test test/database-migration.test.ts` fails
on a clean `dev` checkout with "Core schema has ungenerated database
migrations." Ran `bun script/migration.ts` from packages/core to
generate the missing migration; the only diff is the new index's
migration entry, nothing else changed. Verified: the migration test
and the full `packages/core` suite pass after this (1135 pass, 2
pre-existing unrelated failures in util.flock/util.effect-flock caused
by running as root in this sandbox, not by this change).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SHQKcGH7ayRe8UHJ9CAPQJ
…json

Byte-for-byte fixup after the previous commit — the generator's output
has no trailing newline; my previous push added one by mistake.
alltomatos added a commit that referenced this pull request Sep 15, 2026
Ports PR #244 into this PR so its own unit(linux) check goes green now
instead of waiting on #244 to merge into dev — this is a base-branch-wide
failure (see the standing-down comment on this PR), not caused by this
PR's own changes. No-ops once dev carries #244.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SHQKcGH7ayRe8UHJ9CAPQJ
alltomatos and others added 3 commits September 15, 2026 10:01
…ependent

Ports PR #237 into this PR so its own unit(linux) check goes green now
instead of waiting on #237 to merge — this is the other base-branch-wide
failure on dev (see standing-down comment on this PR), not caused by
this PR's own changes. No-ops once dev carries #237.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SHQKcGH7ayRe8UHJ9CAPQJ

Copy link
Copy Markdown
Owner Author

unit (linux) failed on the previous head (c559b17) too, but not from this PR's own change — @opencode-ai/app:test hit the formatMinutes locale bug, which is red on dev itself (same root cause already diagnosed by #237, fix/stats-format-minutes-locale). Since #237 hasn't merged yet, ported that exact fix into this PR too (verified byte-for-byte against #237's resulting files) so this PR's own CI doesn't wait on either #237 or #241 (which already ported it) to merge first. No-ops once dev carries #237.


Generated by Claude Code


Generated by Claude Code

Copy link
Copy Markdown
Owner Author

Closing — this duplicates #240, opened ~10 hours earlier by another session for the exact same root cause (the same missing session_directory_time_created_id_idx migration, just a different auto-generated migration id since drizzle-kit picks a random name each run). I missed it when I searched for an existing fix. #240 is the one to merge; I'm updating PR #241's ported fix to align with #240's migration instead of this one, to avoid two divergent migration files creating the same index.


Generated by Claude Code


Generated by Claude Code

@alltomatos alltomatos closed this Sep 15, 2026
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.

fix(core): commit generated migration for session directory index

1 participant