بنقرة واحدة
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 المهني
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.
| 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)