Skip to content
Back to skills

Create Migration

ASecurity

Create a new Drizzle migration file with correct naming and update the migration journal

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 6, 2026
ai-agentssqldocker

Security analysis

A100/100

Scanned December 6, 2026

npx -y skills add hyhmrright/Confer --skill create-migration --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Create Migration?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Create Migration
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/hyhmrright-create-migration-confer/badge)](https://www.skillsdirectory.com/skills/hyhmrright-create-migration-confer)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: create-migration
description: Create a new Drizzle migration file with correct naming and update the migration journal
---

创建数据库迁移的正确流程:

1. 确认 schema 变更已写入 `packages/gateway/src/db/schema.ts`
2. 在项目根目录运行:
   ```
   bun run db:generate
   ```
   这会在 `packages/gateway/drizzle/` 下生成正确命名的 SQL 文件,并更新
   `packages/gateway/drizzle/meta/_journal.json`
3. 检查生成的迁移文件内容是否符合预期
4. 运行 `bun run db:migrate` 应用到本地数据库并验证
5. 生产环境额外步骤:
   ```
   docker compose -f docker-compose.prod.yml up migrate --build
   ```

**禁止**直接手写 SQL 文件放入 `packages/gateway/drizzle/` — Drizzle journal 不会感知,
会导致迁移状态不同步(本项目曾因此需要手动 ALTER TABLE 修复)。该目录下的 `.sql`
和 `meta/_journal.json` 已被 `.claude/hooks/guard-protected-files.py` 硬性拦截。

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.