金色时刻 · 15:48
让好资源,触手可及
AGENT SKILL

db-migration

db-migration 是面向数据与分析、数据库的 Agent Skill,来自 hiromaily/go-crypto-wallet。查看技能说明、操作步骤与使用约定,并通过原项目了解详细用法。

Database schema and migration workflow. Use when modifying database schemas in tools/atlas/ or SQLC queries in tools/sqlc/.

SKILL.md

下载 MD ↓
namedb-migration
descriptionDatabase schema and migration workflow. Use when modifying database schemas in tools/atlas/ or SQLC queries in tools/sqlc/.

Database Migration Workflow

Workflow for database schema and migration changes.

Prerequisites

  • Use git-workflow Skill for branch, commit, and PR workflow.
  • Refer to .claude/rules/hcl.md for HCL schema rules (SSOT).
  • Refer to .claude/rules/sql.md for 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

来源:hiromaily/go-crypto-wallet · MIT 许可 · 许可原文 · MD 为来源页保存的历史版本