WithRun MVP 1.3 게시용
테이블 (19)
course_bookmarks
- course_bookmark_id — BIGINT
- course_id — BIGINT — 외래 키 → courses.course_id — NOT NULL
- user_id — BIGINT — 외래 키 → users.user_id — NOT NULL
- created_at — TIMESTAMP — NOT NULL
- updated_at — TIMESTAMP — NOT NULL
- deleted_at — TIMESTAMP
course_difficulties
- course_id — BIGINT — 외래 키 → courses.course_id
- difficulty — VARCHAR(16) — NOT NULL
- created_at — TIMESTAMP — NOT NULL
- updated_at — TIMESTAMP — NOT NULL
- deleted_at — TIMESTAMP
course_likes
- course_like_id — BIGINT
- course_id — BIGINT — 외래 키 → courses.course_id — NOT NULL
- user_id — BIGINT — 외래 키 → users.user_id — NOT NULL
- is_liked — BOOLEAN — NOT NULL
- created_at — TIMESTAMP — NOT NULL
- updated_at — TIMESTAMP — NOT NULL
- deleted_at — TIMESTAMP
course_review_course_types
- course_review_course_type_id — BIGINT
- course_review_id — BIGINT — 외래 키 → course_reviews.course_review_id — NOT NULL
- course_type — VARCHAR(32) — NOT NULL
- created_at — TIMESTAMP — NOT NULL
- updated_at — TIMESTAMP — NOT NULL
- deleted_at — TIMESTAMP
course_reviews
- course_review_id — BIGINT
- course_id — BIGINT — 외래 키 → courses.course_id — NOT NULL
- user_id — BIGINT — 외래 키 → users.user_id — NOT NULL
- rating — SMALLINT — NOT NULL
- submitted_difficulty — VARCHAR(16)
- created_at — TIMESTAMP — NOT NULL
- updated_at — TIMESTAMP — NOT NULL
- deleted_at — TIMESTAMP
course_type_map
- course_type_map_id — BIGINT
- course_id — BIGINT — 외래 키 → courses.course_id — NOT NULL
- course_type — VARCHAR(32) — NOT NULL
- created_at — TIMESTAMP — NOT NULL
- updated_at — TIMESTAMP — NOT NULL
- deleted_at — TIMESTAMP
courses
- course_id — BIGINT
- created_by_user_id — BIGINT — 외래 키 → users.user_id
- title — VARCHAR(120) — NOT NULL
- status — VARCHAR(16) — NOT NULL
- distance_m — INTEGER — NOT NULL
- elevation_gain_m — INTEGER — NOT NULL
- snapshot_image_url — TEXT
- start_latitude — NUMERIC(9, 6) — NOT NULL
- start_longitude — NUMERIC(9, 6) — NOT NULL
- end_latitude — NUMERIC(9, 6)
- end_longitude — NUMERIC(9, 6)
- coordinates — JSONB
- promoted_at — TIMESTAMP
- created_at — TIMESTAMP — NOT NULL
- updated_at — TIMESTAMP — NOT NULL
- deleted_at — TIMESTAMP
ghost_running_results
- ghost_running_result_id — BIGINT
- running_session_id — BIGINT — 외래 키 → running_sessions.running_session_id — NOT NULL
- ghost_target_running_session_id — BIGINT — 외래 키 → running_sessions.running_session_id — NOT NULL
- target_user_id — BIGINT — 외래 키 → users.user_id
- result_status — VARCHAR(16) — NOT NULL
- time_gap_sec — INTEGER — NOT NULL
- distance_gap_m — INTEGER — NOT NULL
- created_at — TIMESTAMP — NOT NULL
- updated_at — TIMESTAMP — NOT NULL
- deleted_at — TIMESTAMP
running_gps_samples
- running_gps_sample_id — BIGINT
- running_session_id — BIGINT — 외래 키 → running_sessions.running_session_id — NOT NULL
- sampled_at — TIMESTAMP — NOT NULL
- user_id — BIGINT — 외래 키 → users.user_id — NOT NULL
- latitude — NUMERIC(9, 6) — NOT NULL
- longitude — NUMERIC(9, 6) — NOT NULL
- altitude_m — NUMERIC(7, 2)
- accuracy_m — NUMERIC(6, 2)
- bearing_deg — NUMERIC(6, 2)
- created_at — TIMESTAMP — NOT NULL
- updated_at — TIMESTAMP — NOT NULL
- deleted_at — TIMESTAMP
running_health_samples
- running_health_sample_id — BIGINT
- running_session_id — BIGINT — 외래 키 → running_sessions.running_session_id — NOT NULL
- sampled_at — TIMESTAMP — NOT NULL
- user_id — BIGINT — 외래 키 → users.user_id — NOT NULL
- heart_rate — SMALLINT
- speed_mps — NUMERIC(6, 3)
- pace_sec_per_km — INTEGER
- distance_m — INTEGER
- calories_kcal — NUMERIC(8, 2)
- altitude_m — NUMERIC(7, 2)
- cadence_spm — SMALLINT
- source_device — VARCHAR(32) — NOT NULL
- created_at — TIMESTAMP — NOT NULL
- updated_at — TIMESTAMP — NOT NULL
- deleted_at — TIMESTAMP
running_session_splits
- running_session_split_id — BIGINT
- running_session_id — BIGINT — 외래 키 → running_sessions.running_session_id — NOT NULL
- split_index — INTEGER — NOT NULL
- split_distance_m — INTEGER — NOT NULL
- split_duration_sec — INTEGER — NOT NULL
- split_pace_sec_per_km — INTEGER — NOT NULL
- avg_heart_rate — INTEGER
- elevation_gain_m — INTEGER — NOT NULL
- created_at — TIMESTAMP — NOT NULL
- updated_at — TIMESTAMP — NOT NULL
- deleted_at — TIMESTAMP
running_sessions
- running_session_id — BIGINT
- user_id — BIGINT — 외래 키 → users.user_id — NOT NULL
- course_id — BIGINT — 외래 키 → courses.course_id
- mode — VARCHAR(16) — NOT NULL
- ghost_target_running_session_id — BIGINT — 외래 키 → running_sessions.running_session_id
- started_at — TIMESTAMP — NOT NULL
- ended_at — TIMESTAMP
- duration_sec — INTEGER
- distance_m — INTEGER — NOT NULL
- avg_speed_mps — NUMERIC(6, 3)
- avg_pace_sec_per_km — INTEGER
- calories_kcal — INTEGER — NOT NULL
- elevation_gain_m — INTEGER — NOT NULL
- snapshot_image_url — TEXT
- start_latitude — NUMERIC(9, 6) — NOT NULL
- start_longitude — NUMERIC(9, 6) — NOT NULL
- end_latitude — NUMERIC(9, 6)
- end_longitude — NUMERIC(9, 6)
- coordinates — JSONB
- is_public — BOOLEAN — NOT NULL
- is_completed — BOOLEAN — NOT NULL
- created_at — TIMESTAMP — NOT NULL
- updated_at — TIMESTAMP — NOT NULL
- deleted_at — TIMESTAMP
user_auth_accounts
- user_id — BIGINT — 외래 키 → users.user_id
- provider — VARCHAR(16) — NOT NULL
- provider_user_id — VARCHAR(191) — NOT NULL
- email — VARCHAR(255)
- profile_image_url — TEXT
- created_at — TIMESTAMP — NOT NULL
- updated_at — TIMESTAMP — NOT NULL
- deleted_at — TIMESTAMP
user_calendars
- user_calendar_id — BIGINT
- user_id — BIGINT — 외래 키 → users.user_id — NOT NULL
- calendar_date — DATE — NOT NULL
- total_distance_m — INTEGER — NOT NULL
- total_duration_sec — INTEGER — NOT NULL
- total_calories_kcal — INTEGER — NOT NULL
- course_run_count — INTEGER — NOT NULL
- free_run_count — INTEGER — NOT NULL
- ghost_run_count — INTEGER — NOT NULL
- representative_snapshot_url — TEXT
- created_at — TIMESTAMP — NOT NULL
- updated_at — TIMESTAMP — NOT NULL
- deleted_at — TIMESTAMP
user_preference_course_types
- user_preference_course_type_id — BIGINT
- user_id — BIGINT — 외래 키 → user_running_preferences.user_id — NOT NULL
- course_type — VARCHAR(32) — NOT NULL
- created_at — TIMESTAMP — NOT NULL
- updated_at — TIMESTAMP — NOT NULL
- deleted_at — TIMESTAMP
user_preference_purposes
- user_preference_purpose_id — BIGINT
- user_id — BIGINT — 외래 키 → user_running_preferences.user_id — NOT NULL
- purpose — VARCHAR(32) — NOT NULL
- created_at — TIMESTAMP — NOT NULL
- updated_at — TIMESTAMP — NOT NULL
- deleted_at — TIMESTAMP
user_preference_time_slots
- user_preference_time_slot_id — BIGINT
- user_id — BIGINT — 외래 키 → user_running_preferences.user_id — NOT NULL
- time_slot — VARCHAR(16) — NOT NULL
- created_at — TIMESTAMP — NOT NULL
- updated_at — TIMESTAMP — NOT NULL
- deleted_at — TIMESTAMP
user_running_preferences
- user_id — BIGINT — 외래 키 → users.user_id
- preferred_difficulty — VARCHAR(16) — NOT NULL
- preferred_distance_km — NUMERIC(5, 2) — NOT NULL
- created_at — TIMESTAMP — NOT NULL
- updated_at — TIMESTAMP — NOT NULL
- deleted_at — TIMESTAMP
users
- user_id — BIGINT
- nickname — VARCHAR(40) — NOT NULL
- birth_date — DATE — NOT NULL
- gender — VARCHAR(16) — NOT NULL
- height_cm — NUMERIC(5, 2) — NOT NULL
- weight_kg — NUMERIC(5, 2) — NOT NULL
- is_active — BOOLEAN — NOT NULL
- created_at — TIMESTAMP — NOT NULL
- updated_at — TIMESTAMP — NOT NULL
- deleted_at — TIMESTAMP
- profile_completed — BOOLEAN