erd40
Tables (10)
learning_card
- id — BIGINT
- subject_id — BIGINT — Foreign key → subject.id — NOT NULL
- card_type — VARCHAR(32) — NOT NULL
- front_text — VARCHAR(4000) — NOT NULL
- back_text — VARCHAR(4000)
- answer_text — VARCHAR(2000)
- explanation — VARCHAR(4000)
- is_ai_generated — BOOLEAN — NOT NULL
- created_at — TIMESTAMP — NOT NULL
- updated_at — TIMESTAMP — NOT NULL
problem
- id — BIGINT
- subject_id — BIGINT — Foreign key → subject.id — NOT NULL
- question — VARCHAR(2000) — NOT NULL
- answer — VARCHAR(2000) — NOT NULL
- explanation — VARCHAR(4000)
- type — VARCHAR(32) — NOT NULL
- difficulty — INTEGER
- option1 — VARCHAR(2000)
- option2 — VARCHAR(2000)
- option3 — VARCHAR(2000)
- option4 — VARCHAR(2000)
- option5 — VARCHAR(2000)
- is_ai_generated — BOOLEAN — NOT NULL
- created_at — TIMESTAMP — NOT NULL
- updated_at — TIMESTAMP — NOT NULL
programming_language_problems
- id — BIGINT
- subject_id — BIGINT — Foreign key → subject.id — NOT NULL
- prog_language — VARCHAR(64) — NOT NULL
- question — VARCHAR(2000) — NOT NULL
- answer — VARCHAR(2000) — NOT NULL
- explanation — VARCHAR(4000)
- difficulty — INTEGER
- is_ai_generated — BOOLEAN — NOT NULL
- created_at — TIMESTAMP — NOT NULL
- updated_at — TIMESTAMP — NOT NULL
study_session
- id — BIGINT
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- subject_id — BIGINT — Foreign key → subject.id — NOT NULL
- session_branch — VARCHAR(32) — NOT NULL
- session_type — VARCHAR(32) — NOT NULL
- status — VARCHAR(32) — NOT NULL
- total_questions — INTEGER — NOT NULL
- correct_count — INTEGER — NOT NULL
- incorrect_count — INTEGER — NOT NULL
- started_at — TIMESTAMP — NOT NULL
- completed_at — TIMESTAMP
- created_at — TIMESTAMP — NOT NULL
- updated_at — TIMESTAMP — NOT NULL
study_session_item
- id — BIGINT
- session_id — BIGINT — Foreign key → study_session.id — NOT NULL
- item_type — VARCHAR(32) — NOT NULL
- reference_id — BIGINT — NOT NULL
- subject_id — BIGINT — Foreign key → subject.id — NOT NULL
- item_order — INTEGER — NOT NULL
- presented_at — TIMESTAMP — NOT NULL
- answered_at — TIMESTAMP
- is_answered — BOOLEAN — NOT NULL
- is_correct — BOOLEAN
- user_submitted_answer — VARCHAR(4000)
- bookmarked_wrong — BOOLEAN — NOT NULL
subject
- id — BIGINT
- name — VARCHAR(255) — NOT NULL
- description — VARCHAR(1000)
- created_at — TIMESTAMP — NOT NULL
- updated_at — TIMESTAMP — NOT NULL
user_answer
- id — BIGINT
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- session_id — BIGINT — Foreign key → study_session.id — NOT NULL
- item_type — VARCHAR(32) — NOT NULL
- reference_id — BIGINT — NOT NULL
- submitted_answer — VARCHAR(4000) — NOT NULL
- is_correct — BOOLEAN — NOT NULL
- submitted_at — TIMESTAMP — NOT NULL
user_statistics
- id — BIGINT
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- subject_id — BIGINT — Foreign key → subject.id — NOT NULL
- branch — VARCHAR(32) — NOT NULL
- total_attempted — INTEGER — NOT NULL
- correct_count — INTEGER — NOT NULL
- incorrect_count — INTEGER — NOT NULL
- last_studied_at — TIMESTAMP
- created_at — TIMESTAMP — NOT NULL
- updated_at — TIMESTAMP — NOT NULL
users
- id — BIGINT
- google_id — VARCHAR(255)
- email — VARCHAR(255) — NOT NULL
- nickname — VARCHAR(255)
- role — VARCHAR(32) — NOT NULL
- free_trial_started_at — TIMESTAMP — NOT NULL
- free_trial_expires_at — TIMESTAMP — NOT NULL
- subscription_started_at — TIMESTAMP
- subscription_expires_at — TIMESTAMP
- created_at — TIMESTAMP — NOT NULL
- updated_at — TIMESTAMP — NOT NULL
- password — VARCHAR(255)
- username — VARCHAR(255) — NOT NULL
wrong_answer_bookmark
- id — BIGINT
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- item_type — VARCHAR(32) — NOT NULL
- reference_id — BIGINT — NOT NULL
- bookmarked_at — TIMESTAMP — NOT NULL
- review_count — INTEGER — NOT NULL
- last_reviewed_at — TIMESTAMP