fix(db): add missing migration to Drizzle journal — fixes CI test failures #337

Merged
jason.woltje merged 2 commits from fix/ci-drizzle-migration-journal into main 2026-03-31 03:03:45 +00:00
Owner

Problem

CI test step has been failing since ~build #437. The pnpm test step fails because Drizzle migrations run against a fresh postgres, and the migration ordering is broken.

Root Cause

0001_cynical_ultimatum.sql exists on disk but was not registered in the Drizzle journal (_journal.json). This file creates tables: agent_logs, insights, preferences, skills, summarization_jobs.

Drizzle follows the journal, so it skips this file entirely. Then 0002_nebulous_mimic.sql tries to ALTER TABLE preferences ADD COLUMN mutable — but preferences was never created.

Local tests pass because dev databases already have these tables from prior runs.

Fix

Inserted 0001_cynical_ultimatum at idx: 1 in the journal and shifted all subsequent entries to idx: 2-7. Verified snapshot metadata is already consistent.

Verification

  • pnpm test — 347 passed (347), 35 tasks successful
  • pnpm lint — clean
  • pnpm typecheck — clean
  • prettier --check — clean
## Problem CI test step has been failing since ~build #437. The `pnpm test` step fails because Drizzle migrations run against a fresh postgres, and the migration ordering is broken. ## Root Cause `0001_cynical_ultimatum.sql` exists on disk but was **not registered** in the Drizzle journal (`_journal.json`). This file creates tables: `agent_logs`, `insights`, `preferences`, `skills`, `summarization_jobs`. Drizzle follows the journal, so it skips this file entirely. Then `0002_nebulous_mimic.sql` tries to `ALTER TABLE preferences ADD COLUMN mutable` — but `preferences` was never created. Local tests pass because dev databases already have these tables from prior runs. ## Fix Inserted `0001_cynical_ultimatum` at `idx: 1` in the journal and shifted all subsequent entries to `idx: 2-7`. Verified snapshot metadata is already consistent. ## Verification - `pnpm test` — 347 passed (347), 35 tasks successful - `pnpm lint` — clean - `pnpm typecheck` — clean - `prettier --check` — clean
jason.woltje added 1 commit 2026-03-31 02:10:49 +00:00
fix(db): add missing 0001_cynical_ultimatum to Drizzle migration journal
Some checks failed
ci/woodpecker/push/ci Pipeline failed
ci/woodpecker/pr/ci Pipeline failed
d367f00077
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).
jason.woltje added 1 commit 2026-03-31 02:15:28 +00:00
fix(db): add CREATE EXTENSION vector before first migration using pgvector
Some checks failed
ci/woodpecker/pr/ci Pipeline failed
ci/woodpecker/push/ci Pipeline failed
9b72f0ea14
The insights table uses vector(1536) but no migration enables the pgvector
extension. CI postgres (pgvector/pgvector:pg17) has the extension available
but it must be explicitly created before use.

Adds CREATE EXTENSION IF NOT EXISTS vector at the top of
0001_cynical_ultimatum.sql (the first migration referencing vector type).
jason.woltje merged commit 492dc18e14 into main 2026-03-31 03:03:45 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#337