Repository navigation
Conversation
1.10.1 曾把 session_parent/proxy/sort 编成 41/42/43,随后又在中间插入 thinking_blocks 与 cache_creation,把这三项改成 43/44/45。已升到旧 43 的库再跑新 44 会 duplicate column name: proxyEnabled,同时永远跳过 41/42 的新列。 让 ADD COLUMN 对 duplicate column 幂等,并在迁移/打开库时补齐缺失列。
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe PR adds additive SQLite schema repair for existing agent tables. File migrations tolerate duplicate-column errors, invoke schema repair, and replace migration history rows. The agent Room database also runs schema repair when it opens. ChangesSQLite schema catch-up
Estimated code review effort: 3 (Moderate) | ~25 minutes Merge Risk: ⚪ Minimal · up to The change makes historical database migrations idempotent and fills missing columns so affected upgrades can start normally while preserving existing data; no actionable merge-blocking risk remains beyond normal checks and review. Sequence Diagram(s)sequenceDiagram
participant RoomDatabase
participant RoomDatabaseCallback
participant SchemaCatchUp
participant SupportSQLiteDatabase
RoomDatabase->>RoomDatabaseCallback: onOpen(db)
RoomDatabaseCallback->>SchemaCatchUp: ensure(db)
SchemaCatchUp->>SupportSQLiteDatabase: inspect tables and columns
SchemaCatchUp->>SupportSQLiteDatabase: ALTER TABLE missing columns
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
问题
部分旧版本数据库曾使用 41/42/43 表示 session_parent、provider_proxy、provider_sort_order。后续版本在 41/42 插入 thinking_blocks 和 cache_creation 后,将原迁移改为 43/44/45。
已升级到旧版本 43 的用户安装新 APK 时,迁移 44 会再次执行
ALTER TABLE ai_providers ADD COLUMN proxyEnabled,触发duplicate column name: proxyEnabled,应用随后进入 CrashActivity,无法正常启动。修复
SchemaCatchUp,按实际表结构补齐所有新增列,兼容迁移编号重排。FileMigration对重复列迁移做幂等处理。已在 Android 16 arm64 设备验证:原本启动即崩溃的数据库升级后可进入
MainActivity,数据库升级到版本 45,原有数据保留。Summary by CodeRabbit