feat: add streak reward and 100-achievement milestone system
这个提交包含在:
@@ -379,6 +379,16 @@ CREATE TABLE IF NOT EXISTS source_crystal_transactions (
|
||||
FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS user_achievement_milestones (
|
||||
user_id INTEGER NOT NULL,
|
||||
milestone_no INTEGER NOT NULL,
|
||||
completed_count_snapshot INTEGER NOT NULL DEFAULT 0,
|
||||
rating_bonus INTEGER NOT NULL DEFAULT 20,
|
||||
created_at INTEGER NOT NULL,
|
||||
PRIMARY KEY(user_id, milestone_no),
|
||||
FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
INSERT OR IGNORE INTO source_crystal_settings(id, monthly_interest_rate, updated_at)
|
||||
VALUES(1, 0.02, strftime('%s','now'));
|
||||
|
||||
@@ -447,3 +457,4 @@ CREATE INDEX IF NOT EXISTS idx_problem_solution_jobs_problem ON problem_solution
|
||||
CREATE INDEX IF NOT EXISTS idx_problem_solutions_problem ON problem_solutions(problem_id, variant, id);
|
||||
CREATE INDEX IF NOT EXISTS idx_user_experience_logs_user_created ON user_experience_logs(user_id, created_at DESC);
|
||||
CREATE INDEX IF NOT EXISTS idx_source_crystal_tx_user_created ON source_crystal_transactions(user_id, created_at DESC);
|
||||
CREATE INDEX IF NOT EXISTS idx_user_achievement_milestones_user_created ON user_achievement_milestones(user_id, created_at DESC);
|
||||
|
||||
在新工单中引用
屏蔽一个用户