-
Notifications
You must be signed in to change notification settings - Fork 0
hyp migrate_en.md
maoxiaoyue edited this page May 14, 2026
·
1 revision
Scan Go Model structs (bun ORM tags), compare with snapshots, auto-generate up/down SQL migrations.
hyp migrate diff # PostgreSQL migration hyp migrate diff --dialect mysql # MySQL migration hyp migrate diff -o db/migrations/ # Custom output directory hyp migrate snapshot # Save current schema snapshot
Compare current models with snapshot, generate SQL migration files.
| Flag | Description | Default |
|---|---|---|
-d, --dialect |
SQL dialect: postgres or mysql
|
postgres |
-o, --output |
Output directory | migrations/ |
-s, --snapshot |
Snapshot file path | .hyp/schema_snapshot.json |
Detected change types: AddTable, DropTable, AddColumn, DropColumn, AlterColumn
Supported bun tags: pk, autoincrement, notnull, unique, type, default
Save current model schema as baseline for future diffs.
| Flag | Description | Default |
|---|---|---|
-s, --snapshot |
Snapshot file path | .hyp/schema_snapshot.json |
# 1. Define/modify model structs (with bun tags) # 2. Generate migration hyp migrate diff # 3. Review generated SQL # 4. Apply SQL to database # 5. Snapshot auto-updated after diff
- hyp generate model — Generate model with bun tags
設計文件
套件
- config — 設定
- context — 請求上下文
- router — 路由器
- server — 伺服器
- middleware — 中介層
- websocket — WebSocket
- hidb — 資料庫 ORM
- hidb/cassandra — Cassandra
- logger — 日誌
- json — JSON 處理
- grpc — gRPC
AI 協作工具鏈
- schema — Schema-first 路由
- manifest — 專案 Manifest
- contract — Contract Testing
- errors — Typed Error Catalog
- migrate — Migration Diff
- scaffold — 智慧 Scaffold
- airules — AI Rules
CLI 命令
- hyp 總覽
- hyp new
- hyp api
- hyp run
- hyp restart
- hyp generate
- hyp migrate
- hyp context
- hyp ai-rules
- hyp chkcomment
- hyp impact
- hyp docker
- hyp health
- hyp version
- hyp difflog
Design Docs
Packages
- config — Configuration
- context — Request Context
- router — Router
- server — Server
- middleware — Middleware
- websocket — WebSocket
- hidb — Database ORM
- hidb/cassandra - Cassandra 5.0
- logger — Logger
- json — JSON
- grpc — gRPC
AI Collaboration Toolchain
- schema — Schema-first Routing
- manifest — Project Manifest
- contract — Contract Testing
- errors — Typed Error Catalog
- migrate — Migration Diff
- scaffold — Smart Scaffold
- airules — AI Rules
CLI Commands