Files
stack/docs/scratchpads/fix-ci-migrations-20260330.md
Jarvis d367f00077
Some checks failed
ci/woodpecker/push/ci Pipeline failed
ci/woodpecker/pr/ci Pipeline failed
fix(db): add missing 0001_cynical_ultimatum to Drizzle migration journal
The migration file 0001_cynical_ultimatum.sql existed on disk but was not
registered in the Drizzle journal (_journal.json). This caused fresh-database
migrations (CI) to skip creating tables (agent_logs, insights, preferences,
skills, summarization_jobs), then 0002_nebulous_mimic.sql would fail trying
to ALTER the non-existent preferences table.

Fix: insert cynical_ultimatum at idx 1 in the journal and shift all
subsequent entries (idx 2-7).

Verified: pnpm test passes (347 tests, 35 tasks).
2026-03-30 21:09:34 -05:00

965 B

Scratchpad — fix-ci-migrations-20260330

Objective

  • Fix Drizzle migration journal ordering so fresh Postgres instances apply all schema migrations in CI.

Plan

  • Inspect migration SQL, journal, and snapshot chain.
  • Patch metadata consistently.
  • Run full test suite.
  • Record result and risks.

Progress

  • Inspected migration files and confirmed 0001_cynical_ultimatum.sql is missing from journal while 0002 depends on it.
  • Patched packages/db/drizzle/meta/_journal.json to insert 0001_cynical_ultimatum at idx 1 and shift later entries to idx 2-7.
  • Verified snapshot content is already semantically aligned with the fixed ordering: the missing tables exist in 0001_snapshot.json, and mutable appears in later snapshots.
  • Installed workspace dependencies in this worktree to make the requested test command runnable.
  • Ran pnpm test successfully; gateway reported 347 passed (347) and Turbo finished with 35 successful, 35 total.