修复倒计时读数冻结、原因输入键盘遮挡、备注括号与任务备注截断

This commit is contained in:
XIGE
2026-11-28 12:36:26 +08:00
parent 5e352c646a
commit 7986a65dce
5 changed files with 83 additions and 28 deletions

View File

@@ -27,7 +27,7 @@ object Store {
const val INBOX_ID = 1L
private const val DB_NAME = "focusbox.db"
private const val DB_VERSION = 3
private const val DB_VERSION = 4
private lateinit var helper: Helper
@@ -109,6 +109,13 @@ object Store {
if (oldVersion < 3) {
db.execSQL("ALTER TABLE tasks ADD COLUMN origin_id INTEGER NOT NULL DEFAULT 0")
}
// v3 → v4:早期版本的原因备注带【】方括号,一次性清掉历史数据
if (oldVersion < 4) {
db.execSQL(
"UPDATE tasks SET note = REPLACE(REPLACE(note, '【', ''), '】', '') " +
"WHERE note LIKE '%【%' OR note LIKE '%】%'"
)
}
}
}