60

Tables (8)

code_programming

  • id — BIGSERIAL
  • subject_id — INTEGER — Foreign key → subject.id
  • question — TEXT — NOT NULL
  • language — TEXT — NOT NULL
  • difficulty — difficulty_type
  • explanation — TEXT
  • points — INTEGER — NOT NULL
  • is_active — BOOLEAN — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL

money_user_have

  • id — BIGSERIAL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • money — NUMERIC(19,4) — NOT NULL
  • currency_type — currency_type_enum — NOT NULL
  • last_earned_at — TIMESTAMPTZ
  • last_spent_at — TIMESTAMPTZ
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL
  • UNIQUE(user_id, — currency_type)

problem

  • id — BIGSERIAL
  • subject_id — INTEGER — Foreign key → subject.id — NOT NULL
  • question_type — question_type_enum — NOT NULL
  • difficulty — difficulty_type
  • question — TEXT — NOT NULL
  • subjective_answer — TEXT
  • explanation — TEXT
  • points — INTEGER — NOT NULL
  • is_active — BOOLEAN — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL

problem_options

  • id — BIGSERIAL
  • problem_id — BIGINT — Foreign key → problem.id — NOT NULL
  • option_no — INTEGER — NOT NULL
  • content — TEXT — NOT NULL
  • is_correct — BOOLEAN — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL
  • UNIQUE(problem_id, — option_no)

study_session

  • id — BIGSERIAL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • subject_id — INTEGER — Foreign key → subject.id — NOT NULL
  • status — session_status_type — NOT NULL
  • type — session_type — NOT NULL
  • started_at — TIMESTAMPTZ — NOT NULL
  • ended_at — TIMESTAMPTZ
  • duration_seconds — INTEGER
  • total_questions — INTEGER — NOT NULL
  • correct_count — INTEGER — NOT NULL
  • score — NUMERIC(5,2)
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL

subject

  • id — SERIAL
  • code — TEXT — NOT NULL
  • name — TEXT — NOT NULL
  • description — TEXT
  • parent_id — INTEGER — Foreign key → subject.id
  • sort_order — INTEGER — NOT NULL
  • is_active — BOOLEAN — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL

subscribe

  • id — BIGSERIAL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • status — subscribe_status_type — NOT NULL
  • trial_started_at — TIMESTAMPTZ
  • trial_expires_at — TIMESTAMPTZ
  • subscription_started_at — TIMESTAMPTZ
  • subscription_expires_at — TIMESTAMPTZ
  • auto_renew — BOOLEAN — NOT NULL
  • payment_method — TEXT
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL

users

  • id — BIGSERIAL
  • google_id — TEXT
  • email — TEXT — NOT NULL
  • password_hash — TEXT
  • username — TEXT — NOT NULL
  • nickname — TEXT
  • role — user_role_type — NOT NULL
  • status — user_status_type — NOT NULL
  • last_login_at — TIMESTAMPTZ
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL
  • deleted_at — TIMESTAMPTZ