1
Tables (14)
bookmarks
- id — BIGINT — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- post_id — BIGINT — Foreign key → swap_posts.id — NOT NULL
- created_at — DATETIME — NOT NULL
cancellations
- id — BIGINT — Primary key — NOT NULL
- room_id — BIGINT — Foreign key → chat_rooms.id — NOT NULL
- requester_id — BIGINT — Foreign key → users.id — NOT NULL
- reason — VARCHAR(20) — NOT NULL
- detail — TEXT
- counter_reported — TINYINT(1) — NOT NULL
- created_at — DATETIME — NOT NULL
chat_messages
- id — BIGINT — Primary key — NOT NULL
- room_id — BIGINT — Foreign key → chat_rooms.id — NOT NULL
- sender_id — BIGINT — Foreign key → users.id
- content — TEXT — NOT NULL
- msg_type — VARCHAR(20) — NOT NULL
- created_at — DATETIME — NOT NULL
chat_rooms
- id — BIGINT — Primary key — NOT NULL
- request_id — BIGINT — Foreign key → swap_requests.id — NOT NULL
- post_a_id — BIGINT — Foreign key → swap_posts.id — NOT NULL
- post_b_id — BIGINT — Foreign key → swap_posts.id — NOT NULL
- status — VARCHAR(20) — NOT NULL
- exchange_time — DATETIME
- verify_deadline — DATETIME
- verified_a — TINYINT(1) — NOT NULL
- verified_b — TINYINT(1) — NOT NULL
- qr_token_a — VARCHAR(100)
- qr_token_b — VARCHAR(100)
- countdown_end — DATETIME
- result_a — VARCHAR(10)
- result_b — VARCHAR(10)
- auto_confirm_at — DATETIME
- last_action_at — DATETIME — NOT NULL
- created_at — DATETIME — NOT NULL
courses
- id — BIGINT — Primary key — NOT NULL
- course_code — VARCHAR(20) — NOT NULL
- name — VARCHAR(100) — NOT NULL
- professor — VARCHAR(50) — NOT NULL
- department — VARCHAR(50) — NOT NULL
- credit — INT — NOT NULL
- time_slot — VARCHAR(100)
- semester — VARCHAR(20) — NOT NULL
graduation_courses
- id — BIGINT — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- course_id — BIGINT — Foreign key → courses.id — NOT NULL
- is_completed — TINYINT(1) — NOT NULL
- created_at — DATETIME — NOT NULL
match_ignores
- id — BIGINT — Primary key — NOT NULL
- post_a_id — BIGINT — Foreign key → swap_posts.id — NOT NULL
- post_b_id — BIGINT — Foreign key → swap_posts.id — NOT NULL
- reason — VARCHAR(20) — NOT NULL
- created_at — DATETIME — NOT NULL
notifications
- id — BIGINT — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- type — VARCHAR(30) — NOT NULL
- ref_id — BIGINT
- message — TEXT — NOT NULL
- is_read — TINYINT(1) — NOT NULL
- created_at — DATETIME — NOT NULL
reports
- id — BIGINT — Primary key — NOT NULL
- reporter_id — BIGINT — Foreign key → users.id — NOT NULL
- target_id — BIGINT — Foreign key → users.id — NOT NULL
- room_id — BIGINT — Foreign key → chat_rooms.id
- reason — VARCHAR(20) — NOT NULL
- evidence_urls — JSON — NOT NULL
- status — VARCHAR(20) — NOT NULL
- created_at — DATETIME — NOT NULL
swap_posts
- id — BIGINT — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- give_course_id — BIGINT — Foreign key → courses.id — NOT NULL
- want_course_1 — BIGINT — Foreign key → courses.id — NOT NULL
- want_course_2 — BIGINT — Foreign key → courses.id
- want_course_3 — BIGINT — Foreign key → courses.id
- kakao_link — VARCHAR(255)
- status — VARCHAR(20) — NOT NULL
- view_count — INT — NOT NULL
- created_at — DATETIME — NOT NULL
- updated_at — DATETIME — NOT NULL
swap_requests
- id — BIGINT — Primary key — NOT NULL
- requester_post_id — BIGINT — Foreign key → swap_posts.id — NOT NULL
- target_post_id — BIGINT — Foreign key → swap_posts.id — NOT NULL
- status — VARCHAR(20) — NOT NULL
- expires_at — DATETIME — NOT NULL
- created_at — DATETIME — NOT NULL
- responded_at — DATETIME
user_blocks
- id — BIGINT — Primary key — NOT NULL
- blocker_id — BIGINT — Foreign key → users.id — NOT NULL
- blocked_id — BIGINT — Foreign key → users.id — NOT NULL
- created_at — DATETIME — NOT NULL
users
- id — BIGINT — Primary key — NOT NULL
- email — VARCHAR(100) — NOT NULL
- password_hash — VARCHAR(255) — NOT NULL
- nickname — VARCHAR(50) — NOT NULL
- warning_count — INT — NOT NULL
- penalty_count — INT — NOT NULL
- suspended_until — DATETIME
- is_blocked — TINYINT(1) — NOT NULL
- created_at — DATETIME — NOT NULL
verification_logs
- id — BIGINT — Primary key — NOT NULL
- room_id — BIGINT — Foreign key → chat_rooms.id — NOT NULL
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- verify_type — VARCHAR(10) — NOT NULL
- image_url — VARCHAR(500) — NOT NULL
- qr_valid — TINYINT(1)
- verified_at — DATETIME
- status — VARCHAR(20) — NOT NULL
- created_at — DATETIME — NOT NULL