docs: add binary build record for B-4 migration fix
- Build: 20261004_215300 - Purpose: B-4 migration fix testing - Package: momentry_20261004_215300.tar.gz
This commit is contained in:
@@ -0,0 +1,132 @@
|
|||||||
|
# Release Binary Build Record
|
||||||
|
|
||||||
|
**日期**: 2026-10-04
|
||||||
|
**構建編號**: 20261004_215300
|
||||||
|
**用途**: B-4 Migration 修復測試
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 構建資訊
|
||||||
|
|
||||||
|
| 項目 | 值 |
|
||||||
|
|------|-----|
|
||||||
|
| **Binary** | `momentry` |
|
||||||
|
| **Platform** | macOS (Apple Silicon) |
|
||||||
|
| **Build Time** | 2026-10-04 21:53:00 |
|
||||||
|
| **Commit** | `c1e3a201` |
|
||||||
|
| **Branch** | main |
|
||||||
|
| **Profile** | release |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 包含的修復
|
||||||
|
|
||||||
|
### B-4 Migration 修復
|
||||||
|
|
||||||
|
**問題**: 27/40 migrations 在 M5Max128 失敗
|
||||||
|
|
||||||
|
**原因**: Migration Runner 未執行 .sql 文件
|
||||||
|
|
||||||
|
**解決**:
|
||||||
|
- 添加 SQL 文件讀取和執行邏輯
|
||||||
|
- Schema 替換支援 (public. -> 當前 schema)
|
||||||
|
- Migration tracking 功能
|
||||||
|
- 跳過已執行的 migration
|
||||||
|
|
||||||
|
**文件**: `src/core/db/postgres_db.rs:1641-1726`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 交付包內容
|
||||||
|
|
||||||
|
```
|
||||||
|
momentry_20261004_215300.tar.gz
|
||||||
|
├── momentry # Release binary
|
||||||
|
├── migrations/ # 40 個 SQL migration 文件
|
||||||
|
│ ├── 001_api_key_management.sql
|
||||||
|
│ ├── 003_job_worker.sql
|
||||||
|
│ ├── ...
|
||||||
|
│ └── 3002_public_schema_pipeline_tables.sql
|
||||||
|
├── VERSION # 構建資訊
|
||||||
|
└── .env.example # 環境變數範例
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 部署步驟
|
||||||
|
|
||||||
|
### M5Max128 部署
|
||||||
|
|
||||||
|
1. **傳輸檔案**
|
||||||
|
```bash
|
||||||
|
scp /tmp/momentry_20261004_215300.tar.gz user@m5max128:/tmp/
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **解壓縮**
|
||||||
|
```bash
|
||||||
|
cd /tmp
|
||||||
|
tar -xzf momentry_20261004_215300.tar.gz
|
||||||
|
cd momentry_delivery_20261004_215300
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **設置權限**
|
||||||
|
```bash
|
||||||
|
chmod +x momentry
|
||||||
|
```
|
||||||
|
|
||||||
|
4. **配置環境變數**
|
||||||
|
```bash
|
||||||
|
export DATABASE_URL="postgres://accusys@localhost:5432/momentry"
|
||||||
|
export DATABASE_SCHEMA="public"
|
||||||
|
export MOMENTRY_OUTPUT_DIR="/Users/accusys/momentry/output"
|
||||||
|
export MOMENTRY_REDIS_PREFIX="momentry:"
|
||||||
|
export MOMENTRY_SERVER_PORT=3002
|
||||||
|
```
|
||||||
|
|
||||||
|
5. **清空資料庫**(可選)
|
||||||
|
```bash
|
||||||
|
psql -U accusys -d momentry -c "DROP SCHEMA public CASCADE; CREATE SCHEMA public;"
|
||||||
|
```
|
||||||
|
|
||||||
|
6. **啟動 server**
|
||||||
|
```bash
|
||||||
|
./momentry server --port 3002
|
||||||
|
```
|
||||||
|
|
||||||
|
7. **驗證 migration**
|
||||||
|
```bash
|
||||||
|
psql -U accusys -d momentry -c "SELECT COUNT(*) FROM schema_migrations;"
|
||||||
|
# 預期: 40 筆記錄
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 驗收標準
|
||||||
|
|
||||||
|
- [ ] Server 成功啟動
|
||||||
|
- [ ] 40 個 migration 全部成功
|
||||||
|
- [ ] `schema_migrations` 有 40 筆記錄
|
||||||
|
- [ ] Health check 通過 (`/health`)
|
||||||
|
- [ ] 無 panic 或錯誤
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 已知問題
|
||||||
|
|
||||||
|
- **B-1**: admin_config.json 缺失(需修復)
|
||||||
|
- **B-2**: 4 個功能為 stub(需確認)
|
||||||
|
- **B-3**: FeatureFlags 配置問題(需修復)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 下一步
|
||||||
|
|
||||||
|
1. 部署到 M5Max128
|
||||||
|
2. 執行 Stage 2 測試
|
||||||
|
3. 驗證 migration 成功
|
||||||
|
4. 處理 B-1, B-2, B-3 阻塞項
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**構建者**: OpenCode
|
||||||
|
**審核者**: 待 M4 確認
|
||||||
Reference in New Issue
Block a user