feat: add learning stats and review plans

This commit is contained in:
Codex
2026-06-28 23:44:52 +08:00
parent e55942dcec
commit dfb383d281
8 changed files with 566 additions and 12 deletions

View File

@@ -0,0 +1,18 @@
create index if not exists idx_practice_sessions_user_started
on public.practice_sessions(tenant_id, user_id, started_at desc);
create index if not exists idx_practice_sessions_user_finished
on public.practice_sessions(tenant_id, user_id, finished_at desc)
where finished_at is not null;
create index if not exists idx_answer_records_user_answered
on public.answer_records(tenant_id, user_id, answered_at desc);
create index if not exists idx_answer_records_session_latest
on public.answer_records(tenant_id, user_id, practice_session_id, question_id, answered_at desc);
create index if not exists idx_wrong_questions_user_review
on public.wrong_questions(tenant_id, user_id, resolved_at, last_wrong_at desc, wrong_count desc);
create index if not exists idx_favorite_questions_user_created
on public.favorite_questions(tenant_id, user_id, created_at desc);