db-migration
Database schema and migration workflow. Use when modifying database schemas in tools/atlas/ or SQLC queries in tools/sqlc/.
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
Database Migration Workflow
Workflow for database schema and migration changes.
Prerequisites
-
Use
git-workflowSkill for branch, commit, and PR workflow. -
Refer to
.claude/rules/hcl.mdfor HCL schema rules (SSOT). -
Refer to
.claude/rules/sql.mdfor SQL query rules (SSOT).
Applicable Files
| Path | Description |
|---|---|
tools/atlas/schemas/*.hcl |
HCL schema definitions (source of truth) |
tools/sqlc/queries/*.sql |
SQLC query definitions |
Workflow
1. Modify Schema (HCL)
Edit HCL files in tools/atlas/schemas/.
2. Verify HCL (from rules/hcl.md)
make atlas-fmt && make atlas-lint
3. Generate Migrations
make atlas-dev-reset
4. Test Migration
docker compose down -v && docker compose up -d
5. Regenerate SQLC (from rules/sql.md)
make extract-sqlc-schema-all && make sqlc
6. Verify Go Code
make check-build && make gotest
Self-Review Checklist
- HCL format/lint passes
- Migration applies cleanly
- SQLC generates correctly
- Go build passes
Related
-
.claude/rules/hcl.md- HCL rules (SSOT) -
.claude/rules/sql.md- SQL rules (SSOT) -
go-development- Go verification after SQLC generation -
git-workflow- Branch, commit, PR workflow
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-01-20
- 索引更新时间
- 2026-01-28
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!