Back to list
wodsmith

local-db

by wodsmith

0🍴 1📅 Jan 26, 2026

SKILL.md


name: local-db description: Handle local database schema changes with Drizzle and D1. Use when making schema changes to src/db/schema.ts, adding/modifying database tables or columns, or when asked about database migrations. Covers the push-based local development workflow and when to generate migrations.

Local Database Workflow

This project uses a push-based workflow for local development to avoid migration file conflicts.

Local Development: Use db:push

When making schema changes during development:

# 1. Edit src/db/schema.ts
# 2. Push changes directly to local D1
pnpm db:push

This applies schema changes directly without generating migration files. No _journal.json conflicts.

When to Generate Migrations

Generate migrations only when ready to merge to main:

# 1. Sync with main first
git fetch origin main
git rebase origin/main

# 2. Reset local DB to match main's migrations (if needed)
pnpm db:setup-local

# 3. Generate a single migration for all schema changes
pnpm db:generate --name=your-feature-name

# 4. Apply locally to verify
pnpm db:migrate:local

# 5. Commit migration files and merge

Key Commands

CommandWhen to Use
pnpm db:pushLocal development - apply schema changes
pnpm db:generate --name=XBefore merging - create migration file
pnpm db:migrate:localApply migrations to local D1
pnpm db:studioBrowse local database

Important Notes

  • Never commit migrations during active development - only at merge time
  • Always rebase/merge main before generating - prevents _journal.json conflicts
  • One migration per feature - consolidates changes into a single file
  • Test migrations locally - run db:migrate:local before pushing
  • CI/CD handles production - never run migrations manually against prod

Score

Total Score

60/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon