fix: 权限变更后不显示旧通知
All checks were successful
PR Preview / teardown-preview (pull_request) Has been skipped
Test / unit-test (push) Successful in 4s
Test / build-check (push) Successful in 4s
PR Preview / test (pull_request) Successful in 4s
PR Preview / deploy-preview (pull_request) Successful in 10s
Test / e2e-test (push) Successful in 51s
All checks were successful
PR Preview / teardown-preview (pull_request) Has been skipped
Test / unit-test (push) Successful in 4s
Test / build-check (push) Successful in 4s
PR Preview / test (pull_request) Successful in 4s
PR Preview / deploy-preview (pull_request) Successful in 10s
Test / e2e-test (push) Successful in 51s
- 新增 role_changed_at 字段,改权限时记录时间 - 通知查询用 MAX(注册时间, 权限变更时间) 过滤 - 确保新增权限的用户只看到变更之后的通知 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -163,6 +163,8 @@ def init_db():
|
||||
c.execute("ALTER TABLE users ADD COLUMN brand_bg TEXT")
|
||||
if "brand_align" not in user_cols:
|
||||
c.execute("ALTER TABLE users ADD COLUMN brand_align TEXT DEFAULT 'center'")
|
||||
if "role_changed_at" not in user_cols:
|
||||
c.execute("ALTER TABLE users ADD COLUMN role_changed_at TEXT")
|
||||
|
||||
# Migration: add tags to user_diary
|
||||
diary_cols = [row[1] for row in c.execute("PRAGMA table_info(user_diary)").fetchall()]
|
||||
|
||||
Reference in New Issue
Block a user