원클릭으로
db-migrate
Create and apply Drizzle ORM migrations against the single Neon-primary PostgreSQL database
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Create and apply Drizzle ORM migrations against the single Neon-primary PostgreSQL database
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | db-migrate |
| description | Create and apply Drizzle ORM migrations against the single Neon-primary PostgreSQL database |
| disable-model-invocation | true |
Guide for creating and applying Drizzle ORM migrations against the RevealUI single Neon-primary PostgreSQL database.
Before creating a migration:
Identify the schema area (all on the single Neon database):
packages/db/src/schema/rest.ts (REST tables) vs packages/db/src/schema/vector.ts (pgvector tables) — both on the same Neon databaseCheck existing schema for conflicts:
# View current schema files
ls packages/db/src/schema/
# Check for table name conflicts
grep -r "export const.*pgTable" packages/db/src/schema/
Verify contracts alignment — new tables/columns should have corresponding Zod schemas:
ls packages/contracts/src/
Edit the appropriate schema file in packages/db/src/schema/:
pgTable, column types, and relationscreatedAt/updatedAt timestamps with defaultscd packages/db
pnpm drizzle-kit generate
Review the generated SQL in packages/db/drizzle/ — check for:
# Development database ONLY — never production
pnpm db:migrate
NEVER run drizzle-kit push — always use drizzle-kit migrate (the PreToolUse hook blocks push).
# Typecheck the db package
pnpm --filter @revealui/db typecheck
# Run db tests
pnpm --filter @revealui/db test
# If schema changes affect contracts, update and test those too
pnpm --filter @revealui/contracts typecheck
pnpm --filter @revealui/contracts test
If you added new tables or columns that are exposed via the API:
packages/contracts/src/packages/contracts/src/index.ts| If your change touches... | Put it in... | Client |
|---|---|---|
| Content, users, sessions, products, orders | packages/db/src/schema/ (NeonDB barrel) | Drizzle ORM |
| Vector embeddings, AI memory | packages/db/src/schema/vector.ts (pgvector) | Drizzle / Neon |
| Session auth | packages/db/src/schema/users.ts | Drizzle / Neon |
All tables live on the single Neon database — there is no second DB client to mix.
If a migration needs to be reverted:
_journal.json)Run the 15-check pre-launch preflight and interpret results with context-aware fix suggestions
Next.js App Router best practices for routing, data fetching, rendering, and optimization.
Next.js Cache Components, 'use cache' directive, PPR, cacheLife, cacheTag, and migration from unstable_cache.
Turborepo monorepo task orchestration, caching, and pipeline configuration guidance.
React composition patterns for building maintainable, reusable component architectures.
Deployment to Vercel including configuration, environment variables, and production best practices.