feat(models): add Asset/ChatTurn, indicator-report relationship, pinned flag

按 W2 plan Task 2 落地数据模型:
- Indicator 加 report / asset / pinned 字段
- Report 加 indicators / assets @Relationship(cascade)
- DiaryEntry 加 tags
- 新增 @Model Asset (原图元数据)
- 新增 @Model ChatTurn (问答历史 + 引用)
- TijiApp Schema 加入新 model

注:Schema 破坏性变更,用户需在 Xcode 里 Erase Simulator
后重启 App。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
link2026
2026-05-25 14:55:26 +08:00
parent c050865db5
commit 2b6c4b9726
2 changed files with 64 additions and 2 deletions

View File

@@ -8,6 +8,8 @@ struct TijiApp: App {
Indicator.self,
Report.self,
DiaryEntry.self,
Asset.self,
ChatTurn.self,
])
let config = ModelConfiguration(schema: schema, isStoredInMemoryOnly: false)
do {