Sample_SWITH
Tables (26)
admin_audit_logs
- id — BIGINT — Primary key — NOT NULL
- admin_id — BIGINT — Foreign key → users.id
- action — VARCHAR(100) — NOT NULL
- target_type — VARCHAR(50) — NOT NULL
- target_id — BIGINT
- detail — JSON
- created_at — TIMESTAMP — NOT NULL
code_analyses
- id — BIGINT — Primary key — NOT NULL
- submission_id — BIGINT — Foreign key → problem_submissions.id — NOT NULL
- analysis_type — VARCHAR(30) — NOT NULL
- status — VARCHAR(20) — NOT NULL
- result_data — JSON
- error_message — TEXT
- latency_ms — INTEGER
- prompt_tokens — INTEGER
- completion_tokens — INTEGER
- total_tokens — INTEGER
code_visualizations
- id — BIGINT — Primary key — NOT NULL
- submission_id — BIGINT — Foreign key → problem_submissions.id — NOT NULL
- code_hash — CHAR(64) — NOT NULL
- status — VARCHAR(20) — NOT NULL
- result_data — JSON
- result_url — TEXT
- error_message — TEXT
- created_at — TIMESTAMP — NOT NULL
group_members
- group_id — BIGINT — Foreign key → study_groups.id — NOT NULL
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- role — VARCHAR(20) — NOT NULL
- status — VARCHAR(20) — NOT NULL
- joined_at — TIMESTAMP — NOT NULL
- left_at — TIMESTAMP
group_notices
- id — BIGINT — Primary key — NOT NULL
- group_id — BIGINT — Foreign key → study_groups.id — NOT NULL
- author_id — BIGINT — Foreign key → users.id — NOT NULL
- content — TEXT — NOT NULL
- created_at — TIMESTAMP — NOT NULL
- deleted_at — TIMESTAMP
group_stats
- group_id — BIGINT — Foreign key → study_groups.id — NOT NULL
- score — BIGINT — NOT NULL
- streak_days — INTEGER — NOT NULL
- updated_at — TIMESTAMP — NOT NULL
inquiries
- id — BIGINT — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → users.id
- category — VARCHAR(30) — NOT NULL
- title — VARCHAR(200) — NOT NULL
- content — TEXT — NOT NULL
- status — VARCHAR(20) — NOT NULL
- answer — TEXT
- created_at — TIMESTAMP — NOT NULL
- answered_at — TIMESTAMP
- deleted_at — TIMESTAMP
problem_attempts
- id — BIGINT — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- problem_id — BIGINT — Foreign key → problems.id — NOT NULL
- status — VARCHAR(20) — NOT NULL
- elapsed_seconds — INTEGER — NOT NULL
- finished_at — TIMESTAMP
problem_folders
- id — BIGINT — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- name — VARCHAR(100) — NOT NULL
problem_submissions
- id — BIGINT — Primary key — NOT NULL
- attempt_id — BIGINT — Foreign key → problem_attempts.id — NOT NULL
- version_no — INTEGER — NOT NULL
- language — VARCHAR(20) — NOT NULL
- source_code — TEXT — NOT NULL
- submission_type — VARCHAR(20) — NOT NULL
- result_status — VARCHAR(40)
- execution_time_ms — INTEGER
- memory_usage_kb — INTEGER
- created_at — TIMESTAMP — NOT NULL
problem_tags
- problem_id — BIGINT — Foreign key → problems.id — NOT NULL
- tag_id — BIGINT — Foreign key → tags.id — NOT NULL
problem_test_cases
- id — BIGINT — Primary key — NOT NULL
- problem_id — BIGINT — Foreign key → problems.id — NOT NULL
- case_type — VARCHAR(20) — NOT NULL
- input_data — TEXT — NOT NULL
- expected_output — TEXT — NOT NULL
- explanation — TEXT
- sequence_no — INTEGER — NOT NULL
- is_active — BOOLEAN — NOT NULL
problems
- id — BIGINT — Primary key — NOT NULL
- source — VARCHAR(30) — NOT NULL
- external_id — VARCHAR(50) — NOT NULL
- title — VARCHAR(200) — NOT NULL
- difficulty — SMALLINT — NOT NULL
- acceptance_rate — NUMERIC(5, 2)
- url — TEXT — NOT NULL
- content — TEXT
- time_limit_ms — INTEGER
- memory_limit_mb — INTEGER
saved_problems
- folder_id — BIGINT — Foreign key → problem_folders.id — NOT NULL
- problem_id — BIGINT — Foreign key → problems.id — NOT NULL
- saved_at — TIMESTAMP — NOT NULL
study_attendances
- session_id — BIGINT — Foreign key → study_sessions.id — NOT NULL
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- status — VARCHAR(20) — NOT NULL
- joined_at — TIMESTAMP
study_groups
- id — BIGINT — Primary key — NOT NULL
- name — VARCHAR(100) — NOT NULL
- description — VARCHAR(255)
- image_url — TEXT
- invite_token — VARCHAR(255) — NOT NULL
- max_members — SMALLINT — NOT NULL
- status — VARCHAR(20) — NOT NULL
- created_at — TIMESTAMP — NOT NULL
- deleted_at — TIMESTAMP
study_presentations
- id — BIGINT — Primary key — NOT NULL
- session_id — BIGINT — Foreign key → study_sessions.id — NOT NULL
- problem_id — BIGINT — Foreign key → problems.id — NOT NULL
- presenter_id — BIGINT — Foreign key → users.id — NOT NULL
- submission_id — BIGINT — Foreign key → problem_submissions.id — NOT NULL
- presented_order — INTEGER — NOT NULL
- duration_seconds — INTEGER — NOT NULL
- presented_at — TIMESTAMP
study_session_problems
- session_id — BIGINT — Foreign key → study_sessions.id — NOT NULL
- problem_id — BIGINT — Foreign key → problems.id — NOT NULL
- sequence_no — INTEGER — NOT NULL
- is_recommended — BOOLEAN — NOT NULL
study_sessions
- id — BIGINT — Primary key — NOT NULL
- group_id — BIGINT — Foreign key → study_groups.id — NOT NULL
- title — VARCHAR(150) — NOT NULL
- description — TEXT
- studied_at — DATE
- started_at — TIMESTAMP
- ended_at — TIMESTAMP
- status — VARCHAR(20) — NOT NULL
tags
- id — BIGINT — Primary key — NOT NULL
- name — VARCHAR(50) — NOT NULL
terms
- id — BIGINT — Primary key — NOT NULL
- term_type — VARCHAR(30) — NOT NULL
- version — VARCHAR(20) — NOT NULL
- title — VARCHAR(100) — NOT NULL
- content — TEXT — NOT NULL
- is_active — BOOLEAN — NOT NULL
- created_at — TIMESTAMP — NOT NULL
user_activity_events
- id — BIGINT — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → users.id
- event_type — VARCHAR(50) — NOT NULL
- target_type — VARCHAR(50)
- target_id — BIGINT
- metadata — JSON
- created_at — TIMESTAMP — NOT NULL
user_oauth_accounts
- id — BIGINT — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- provider — VARCHAR(20) — NOT NULL
- provider_user_id — VARCHAR(255) — NOT NULL
- provider_email — VARCHAR(255)
- created_at — TIMESTAMP — NOT NULL
user_profiles
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- solved_ac_handle — VARCHAR(50)
- preferred_language — VARCHAR(20)
- introduction — VARCHAR(255)
user_term_agreements
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- term_id — BIGINT — Foreign key → terms.id — NOT NULL
- agreed_at — TIMESTAMP — NOT NULL
users
- id — BIGINT — Primary key — NOT NULL
- nickname — VARCHAR(30) — NOT NULL
- profile_image_url — TEXT
- role — VARCHAR(20) — NOT NULL
- status — VARCHAR(20) — NOT NULL
- created_at — TIMESTAMP — NOT NULL
- deleted_at — TIMESTAMP