FinQuiz
Tables (20)
accounts
- id — bigint
- user_id — bigint — Foreign key → users.id — NOT NULL
- email — varchar(255) — NOT NULL
- email_normalized — varchar(255) — NOT NULL
- password_hash — varchar(255)
- is_email_verified — boolean
- status — ENUM
- last_login_at — datetime
- created_at — datetime
- updated_at — datetime
articles
- id — bigint
- title — varchar(255) — NOT NULL
- body_md — text — NOT NULL
- image_url — varchar(255)
- source_note — varchar(255)
- created_at — datetime
- updated_at — datetime
auth_identities
- id — bigint
- account_id — bigint — Foreign key → accounts.id — NOT NULL
- provider — varchar(255) — NOT NULL
- provider_user_id — varchar(255) — NOT NULL
- email — varchar(255)
- display_name — varchar(255)
- linked_at — datetime
auth_sessions
- id — bigint
- account_id — bigint — Foreign key → accounts.id — NOT NULL
- session_token — varchar(255) — NOT NULL
- user_agent — varchar(255)
- ip_address — varchar(255)
- expires_at — datetime
- created_at — datetime
- revoked_at — datetime
auth_tokens
- id — bigint
- account_id — bigint — Foreign key → accounts.id — NOT NULL
- type — varchar(255) — NOT NULL
- token — varchar(255) — NOT NULL
- expires_at — datetime
- created_at — datetime
- used_at — datetime
badges
- id — bigint
- code — varchar(255) — NOT NULL
- name — varchar(255) — NOT NULL
- description — text
- icon_url — varchar(255)
- criteria_json — text
- created_at — datetime
- updated_at — datetime
levels
- id — bigint
- subsector_id — bigint — Foreign key → subsectors.id — NOT NULL
- level_number — int — NOT NULL
- title — varchar(255)
- learning_goal — text
- badge_id — bigint
- created_at — datetime
- updated_at — datetime
question_options
- id — bigint
- question_id — bigint — Foreign key → questions.id — NOT NULL
- label — varchar(255) — NOT NULL
- content_md — text — NOT NULL
- is_correct — boolean — NOT NULL
- feedback_md — text
- sort_order — int
question_teaching_concepts
- id — bigint
- question_id — bigint — Foreign key → questions.id — NOT NULL
- term — varchar(255) — NOT NULL
- definition_md — text — NOT NULL
- icon_emoji — varchar(255)
- sort_order — int
questions
- id — bigint
- quiz_id — bigint — Foreign key → quizzes.id — NOT NULL
- type — ENUM — NOT NULL
- stem_md — text — NOT NULL
- difficulty — int
- sort_order — int
- options_required — int — NOT NULL
- max_correct — int — NOT NULL
- option_shuffle — boolean
- story_id — bigint — Foreign key → stories.id
- article_id — bigint — Foreign key → articles.id
- hint_md — text
- teaching_intro_md — text
- teaching_summary_md — text
- teaching_explainer_md — text
- example_calc_md — text
- solving_keypoints_md — text
- teaching_illustration_url — varchar(255)
- created_at — datetime
- updated_at — datetime
quizzes
- id — bigint
- subsector_id — bigint — Foreign key → subsectors.id — NOT NULL
- level_id — bigint — Foreign key → levels.id — NOT NULL
- title — varchar(255)
- time_limit_sec — int
- passing_score — int
- sort_order — int
- status — varchar(255)
- created_at — datetime
- updated_at — datetime
sectors
- id — bigint
- name — varchar(255) — NOT NULL
- slug — varchar(255) — NOT NULL
- description — text
- created_at — datetime
- updated_at — datetime
stories
- id — bigint
- title — varchar(255)
- body_md — text — NOT NULL
- created_at — datetime
- updated_at — datetime
subsectors
- id — bigint
- sector_id — bigint — Foreign key → sectors.id — NOT NULL
- name — varchar(255) — NOT NULL
- slug — varchar(255) — NOT NULL
- description — text
- sort_order — int
- created_at — datetime
- updated_at — datetime
user_answers
- id — bigint
- user_id — bigint — Foreign key → users.id — NOT NULL
- question_id — bigint — Foreign key → questions.id — NOT NULL
- selected_option_id — bigint — Foreign key → question_options.id
- is_correct — boolean
- answered_at — datetime
- teaching_viewed_at — datetime
user_badges
- id — bigint
- user_id — bigint — Foreign key → users.id — NOT NULL
- badge_id — bigint — Foreign key → badges.id — NOT NULL
- awarded_at — datetime
- source — varchar(255)
- meta_json — text
user_daily_activity
- activity_date — date — Primary key — NOT NULL
- user_id — bigint — Foreign key → users.id — NOT NULL
- questions_answered — int
- quizzes_completed — int
- minutes_spent — int
- first_activity_at — datetime
- last_activity_at — datetime
- created_at — datetime
- updated_at — datetime
user_progress
- id — bigint
- user_id — bigint — Foreign key → users.id — NOT NULL
- quiz_id — bigint — Foreign key → quizzes.id — NOT NULL
- started_at — datetime
- finished_at — datetime
- score — int
- passed — boolean
- teaching_views — int
- created_at — datetime
user_wrong_notes
- id — bigint
- user_id — bigint — Foreign key → users.id — NOT NULL
- question_id — bigint — Foreign key → questions.id — NOT NULL
- last_answer_option_id — bigint — Foreign key → question_options.id
- correct_option_id — bigint — Foreign key → question_options.id
- times_wrong — int
- first_wrong_at — datetime
- last_wrong_at — datetime
- reviewed_at — datetime
- resolved — boolean
- pinned — boolean
- personal_note_md — text
- snapshot_teaching_summary_md — text
- snapshot_teaching_explainer_md — text
- snapshot_keypoints_md — text
- created_at — datetime
- updated_at — datetime
users
- id — bigint
- email — varchar(255)
- nickname — varchar(255)
- avatar_url — varchar(255)
- age_group — varchar(255)
- locale — varchar(255)
- created_at — datetime