Create, review, apply, squash, or validate shared PostgreSQL migrations in this monorepo. Use when changing `packages/db/src/schema.ts`, generating Drizzle migrations, adding backfills, or checking migration bootstrap behavior.
설치
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
Create, review, apply, squash, or validate shared PostgreSQL migrations in this monorepo. Use when changing `packages/db/src/schema.ts`, generating Drizzle migrations, adding backfills, or checking migration bootstrap behavior.
Shared PostgreSQL migrations
This skill covers shared PostgreSQL migrations only. It does not govern Durable Object SQLite or Wrangler migrations. Read packages/db/AGENTS.md first; it is canonical for shared PostgreSQL and Drizzle invariants. Use the git-rebase skill for migration conflicts during a rebase.
Workflow
Read packages/db/AGENTS.md and inspect relevant schema and migration files.
Change packages/db/src/schema.ts first.
Generate artifacts with pnpm drizzle generate.
Inspect generated SQL.
Review generated DDL for destructive operations and data loss. Prefer
additive or staged schema changes. If generated DDL is unsafe, wrong, or too
broad, correct the schema and regenerate. Do not hand-edit generated DDL,
snapshots, or journal entries.
Append only intentional UPDATE or INSERT data backfills after generated DDL, separated with --> statement-breakpoint.
Apply migrations with pnpm drizzle migrate or run pnpm drizzle:verify-bootstrap when relevant.
Run pnpm format and targeted schema or migration checks.
Prefer one generated migration per unshipped feature branch. To squash
migrations before shipping, remove the branch-local migration SQL, snapshots,
and journal entries, then regenerate once from the current schema. Re-append
intentional backfills afterward.
Keep generated artifacts generated. packages/db/AGENTS.md also covers shared-schema PII requirements and DB-backed timestamp serialization.