Skip to content

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

Description

@alltomatos

Contexto

unit (linux) and unit (windows) are currently red on dev itself (confirmed on the latest dev commit, run https://github.com/alltomatos/opencode/actions/runs/34911995346/job/104201311221), from test/database-migration.test.ts > "declared schema has no ungenerated migrations". Blocks CI on every open PR regardless of what it touches — including #234 and #237.

Root cause

perf(core): add composite index on session(directory, time_created, id) (closes #229) (commit 5372b2ed3f) added an index declaration to packages/core/src/session/sql.ts:

index("session_directory_time_created_id_idx").on(table.directory, table.time_created, table.id),

but never ran the migration generator, so the declared Drizzle schema and the committed migration/snapshot (schema.json, schema.gen.ts, migration.gen.ts) diverged. The check script's own error names the fix: "Run bun script/migration.ts from packages/core."

Fix

Ran bun script/migration.ts from packages/core (no manual edits to any generated file) and committed the result: a new migration file, and the regenerated schema.json/schema.gen.ts/migration.gen.ts.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions