一键导入
db-schema-mgmt
Rules that MUST be followed when working on database schema related tasks with Atlas and GORM.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Rules that MUST be followed when working on database schema related tasks with Atlas and GORM.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Comprehensive Atlas database schema management. Use when working with Atlas migrations, schema inspection, diffing, linting, or applying database changes.
A test skill that greets the user. Use when the user says hello or asks for a greeting.
| name | db-schema-mgmt |
| description | Rules that MUST be followed when working on database schema related tasks with Atlas and GORM. |
This project uses Atlas for database schema management with GORM models.
When the schema changes, generate a new migration:
atlas migrate diff --env gorm <migration_name>
| Task | Command |
|---|---|
| Generate migration | atlas migrate diff --env gorm <name> |
| Validate migrations | atlas migrate validate --env gorm |
| Check status | atlas migrate status --env gorm |
| Fix checksums | atlas migrate hash --env gorm |
models/ directoryatlas migrate diff --env gorm add_description_fieldmigrations/atlas migrate validate --env gormgo test ./...⚠️ NEVER modify existing migration files - this breaks linear history
⚠️ ALWAYS create NEW migrations for schema changes
⚠️ Run atlas migrate hash if you must edit an unapplied migration
atlas migrate validate --env gorm
# Fix issues, then:
atlas migrate hash --env gorm
├── atlas.hcl # Atlas configuration
├── models/ # GORM models (source of truth)
│ └── todos.go
├── migrations/ # Atlas versioned migrations
│ ├── atlas.sum # Integrity checksums (don't edit)
│ └── *.sql # Migration files
The atlas.hcl uses atlas-provider-gorm to read GORM model definitions and compare them against the migrations directory.