51

Tables (11)

code_programming

  • id — bigint — Primary key — NOT NULL
  • subject_id — int — Foreign key → subject.id
  • question — text — NOT NULL
  • subjective_answer — text — NOT NULL
  • language — varchar(50)
  • difficulty — difficulty_level
  • explanation — text
  • points — int — NOT NULL
  • is_active — boolean — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

money_user_have

  • id — bigint — Primary key — NOT NULL
  • user_id — bigint — Foreign key → users.id — NOT NULL
  • money — decimal(19,4)
  • currency_type — currency_type_enum — NOT NULL
  • last_earned_at — timestamp
  • last_spent_at — timestamp
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

problem

  • id — bigint — Primary key — NOT NULL
  • subject_id — int — Foreign key → subject.id — NOT NULL
  • question_type — question_type_enum — NOT NULL
  • difficulty — difficulty_level
  • question — text — NOT NULL
  • subjective_answer — text — NOT NULL
  • option1 — text
  • option2 — text
  • option3 — text
  • option4 — text
  • option5 — text
  • correct_option — int — 정답
  • explanation — text — 문제
  • points — int — NOT NULL
  • is_active — boolean — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

study_session

  • id — bigint — Primary key — NOT NULL
  • user_id — bigint — Foreign key → users.id — NOT NULL
  • subject_id — int — Foreign key → subject.id — NOT NULL
  • status — session_status — NOT NULL
  • type — session_type — NOT NULL
  • started_at — timestamp — NOT NULL
  • ended_at — timestamp
  • duration_seconds — int
  • total_questions — int — NOT NULL
  • correct_count — int — NOT NULL
  • score — decimal(5,2) — 점수
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

subject

  • id — int — Primary key — NOT NULL
  • code — varchar(50) — NOT NULL
  • name — varchar(255) — NOT NULL
  • description — varchar(1000)
  • parent_id — int — Foreign key → subject.id — 상위
  • sort_order — int — NOT NULL
  • is_active — boolean — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

subscribe

  • id — bigint — Primary key — NOT NULL
  • user_id — bigint — Foreign key → users.id — NOT NULL
  • status — subscription_status — NOT NULL
  • trial_started_at — timestamp
  • trial_expires_at — timestamp
  • subscription_started_at — timestamp
  • subscription_expires_at — timestamp — 구독
  • auto_renew — boolean — NOT NULL
  • payment_method — varchar(50)
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

user_answer

  • id — bigint — Primary key — NOT NULL
  • user_id — bigint — Foreign key → users.id — NOT NULL
  • session_id — bigint — Foreign key → study_session.id — NOT NULL
  • reference_id — bigint — NOT NULL
  • item_type — item_type_enum — NOT NULL — 문제
  • submitted_answer — text — NOT NULL
  • is_wrong_answer — boolean — NOT NULL — 오답
  • time_spent_seconds — int
  • submitted_at — timestamp — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

user_answer_history

  • id — bigint — Primary key — NOT NULL
  • user_answer_id — bigint — Foreign key → user_answer.id — NOT NULL
  • user_id — bigint — Foreign key → users.id — NOT NULL
  • action — action_type — NOT NULL
  • old_answer — text
  • new_answer — text
  • changed_at — timestamp — NOT NULL
  • changed_by — bigint — Foreign key → users.id
  • created_at — timestamp — NOT NULL

user_statistics

  • id — bigint — Primary key — NOT NULL
  • user_id — bigint — Foreign key → users.id — NOT NULL
  • subject_id — int — Foreign key → subject.id — NOT NULL
  • branch — varchar(255)
  • total_attempted — int — NOT NULL
  • wrong_count — int — NOT NULL
  • correct_count — int — NOT NULL
  • accuracy_rate — decimal(5,2)
  • last_studied_at — timestamp
  • streak_days — int — NOT NULL — 연속
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

users

  • id — bigint — Primary key — NOT NULL
  • google_id — varchar(255)
  • email — varchar(255) — NOT NULL — 사용자
  • password_hash — varchar(255) — 비밀번호
  • username — varchar(255) — NOT NULL
  • nickname — varchar(255)
  • role — user_role — NOT NULL — 사용자
  • status — user_status — NOT NULL — 계정
  • last_login_at — timestamp
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL
  • deleted_at — timestamp — 소프트

wrong_answer_bookmark

  • id — bigint — Primary key — NOT NULL
  • user_id — bigint — Foreign key → users.id — NOT NULL
  • item_type — item_type_enum — NOT NULL
  • reference_id — bigint — NOT NULL
  • bookmarked_at — timestamp — NOT NULL
  • review_count — int — NOT NULL — 복습
  • last_reviewed_at — timestamp
  • notes — text — 사용자
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL