Handle Drizzle database schema changes safely. Generate and apply migrations, add tables and columns. Use when modifying database schema, adding tables, creating migrations, or making database changes.
Safely modify PostgreSQL schema using Drizzle ORM.
| File | Purpose |
| -------------------------------- | --------------------- |
| packages/db/src/schema.ts | Main schema exports |
| packages/db/src/auth-schema.ts | Better Auth tables |
| packages/db/src/rag-schema.ts | RAG embeddings tables |
| packages/db/drizzle/ | Generated migrations |
Read the schema file to understand existing tables:
Read: packages/db/src/schema.ts
Before making changes, confirm with user:
Edit the appropriate schema file:
// packages/db/src/schema.ts
import { pgTable, text, timestamp, uuid } from 'drizzle-orm/pg-core';
export const newTable = pgTable('new_table', {
id: uuid('id').primaryKey().defaultRandom(),
name: text('name').notNull(),
createdAt: timestamp('created_at').defaultNow().notNull(),
updatedAt: timestamp('updated_at').defaultNow().notNull(),
});
Run migration generator:
pnpm -C packages/db migrate:generate
Read the generated migration in packages/db/drizzle/ and verify:
pnpm -C packages/db migrate:apply
pnpm typecheck
pnpm lint
npx skills add jamesjlundin/db-schema-change下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer