AGENT SKILL

migration

Use when creating, running, or reviewing database migrations.

使用场景后端与接口
License 许可
AGPL-3.0
最近更新
2026-11-11
Stars
★ 0
Forks
0

01 前言 Front Matter

name
migration
description
Use when creating, running, or reviewing database migrations.

03 SKILL.md 正文

Database Migration

Rules

  • Use node-pg-migrate.
  • Define table names in db/config; do not hardcode them in migrations.
  • Use migration helpers such as toSchemaString for enum/schema strings.
  • Do not edit src/infra/config/drizzle by hand.
  • After a successful migration, run npm run drizzle:pull.

Commands

  • Create: npm run db:migrate create <name-in-kebab-case>
  • Run up: npm run db:migrate up
  • Roll back one: npm run db:migrate
  • Roll back N: npm run db:migrate <count>

04 同仓库更多 Skills