Skip to content

fix: make db:migrate work with proper journal and env loading#284

Merged
zbigniewsobiecki merged 2 commits intodevfrom
fix/migration-journal
Feb 16, 2026
Merged

fix: make db:migrate work with proper journal and env loading#284
zbigniewsobiecki merged 2 commits intodevfrom
fix/migration-journal

Conversation

@zbigniewsobiecki
Copy link
Copy Markdown
Member

Summary

  • Populate meta/_journal.json with entries for all 5 migrations (was empty because migrations were hand-written, not generated by drizzle-kit generate)
  • Add db-bootstrap-journal.ts tool to seed drizzle.__drizzle_migrations tracking table for databases previously set up with drizzle-kit push
  • Fix db:migrate/db:push/db:studio package.json scripts to load .env via node --env-file=.env (drizzle-kit doesn't load dotenv)
  • Add db:bootstrap-journal script to package.json
  • Document migration workflow in CLAUDE.md

Root cause

The database was originally set up with drizzle-kit push which doesn't create a migration journal. When drizzle-kit migrate runs, it reads meta/_journal.json for the list of migrations — empty journal means nothing to apply.

Test plan

  • npm run db:migrate works without manual source .env
  • npm run db:migrate is idempotent (no-op when all migrations applied)
  • New migrations added to journal get applied on next db:migrate
  • All 925 tests pass

🤖 Generated with Claude Code

- Populate meta/_journal.json with entries for all 5 migrations (was
  empty because migrations were hand-written, not generated)
- Add db-bootstrap-journal.ts tool to seed drizzle.__drizzle_migrations
  tracking table for databases set up with drizzle-kit push
- Fix db:migrate/push/studio package.json scripts to load .env via
  node --env-file=.env (drizzle-kit doesn't load dotenv)
- Add db:bootstrap-journal script to package.json
- Document migration workflow in CLAUDE.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Deduplicate respond-to-pr-comment and respond-to-review agents
into a shared prResponseAgent module with common PR context
fetching, comment handling, and response formatting.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@zbigniewsobiecki zbigniewsobiecki merged commit 18c9b12 into dev Feb 16, 2026
4 checks passed
@zbigniewsobiecki zbigniewsobiecki deleted the fix/migration-journal branch February 16, 2026 10:53
This was referenced Feb 16, 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.

1 participant