sinchonthon

Tables (17)

board_comments

  • id — BIGINT — Primary key — NOT NULL
  • post_id — BIGINT — Foreign key → board_posts.id — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • parent_comment_id — BIGINT — Foreign key → board_comments.id
  • content — TEXT — NOT NULL
  • status — VARCHAR(20) — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

board_posts

  • id — BIGINT — Primary key — NOT NULL
  • board_id — BIGINT — Foreign key → boards.id — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • title — VARCHAR(150) — NOT NULL
  • content — TEXT — NOT NULL
  • status — VARCHAR(20) — NOT NULL
  • view_count — INT — NOT NULL
  • comment_count — INT — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

boards

  • id — BIGINT — Primary key — NOT NULL
  • name — VARCHAR(50) — NOT NULL
  • slug — VARCHAR(50) — NOT NULL
  • description — VARCHAR(255)
  • is_active — BOOLEAN — NOT NULL

categories

  • id — BIGINT — Primary key — NOT NULL
  • name — VARCHAR(30) — NOT NULL
  • slug — VARCHAR(30) — NOT NULL
  • icon_name — VARCHAR(50)
  • color — VARCHAR(20)
  • sort_order — INT — NOT NULL
  • is_active — BOOLEAN — NOT NULL

notifications

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • actor_user_id — BIGINT — Foreign key → users.id
  • notification_type — VARCHAR(30) — NOT NULL — new_comment, new_follower, tip_reaction
  • reference_type — VARCHAR(20)
  • reference_id — BIGINT
  • is_read — BOOLEAN — NOT NULL
  • created_at — DATETIME — NOT NULL

places

  • id — BIGINT — Primary key — NOT NULL
  • category_id — BIGINT — Foreign key → categories.id
  • created_by — BIGINT — Foreign key → users.id
  • name — VARCHAR(150) — NOT NULL
  • address — VARCHAR(255)
  • road_address — VARCHAR(255)
  • latitude — DECIMAL(10, 7) — NOT NULL
  • longitude — DECIMAL(10, 7) — NOT NULL
  • phone — VARCHAR(30)
  • external_source — VARCHAR(20) — kakao, naver, google, user
  • external_place_id — VARCHAR(100)
  • status — VARCHAR(20) — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

promotions

  • id — BIGINT — Primary key — NOT NULL
  • advertiser_id — BIGINT — Foreign key → users.id — NOT NULL
  • place_id — BIGINT — Foreign key → places.id
  • tip_id — BIGINT — Foreign key → tips.id
  • category_id — BIGINT — Foreign key → categories.id
  • promotion_type — VARCHAR(30) — NOT NULL — sponsored_tip, place_boost, job_boost
  • title — VARCHAR(100)
  • starts_at — DATETIME — NOT NULL
  • ends_at — DATETIME — NOT NULL
  • status — VARCHAR(20) — NOT NULL
  • daily_budget — INT
  • total_budget — INT
  • created_at — DATETIME — NOT NULL

reports

  • id — BIGINT — Primary key — NOT NULL
  • reporter_id — BIGINT — Foreign key → users.id — NOT NULL
  • target_type — VARCHAR(20) — NOT NULL — tip, tip_comment, board_post, board_comment, user
  • target_id — BIGINT — NOT NULL
  • reason_type — VARCHAR(30) — NOT NULL
  • description — TEXT
  • status — VARCHAR(20) — NOT NULL — pending, accepted, rejected
  • reviewed_by — BIGINT — Foreign key → users.id
  • reviewed_at — DATETIME
  • created_at — DATETIME — NOT NULL

schools

  • id — BIGINT — Primary key — NOT NULL
  • name — VARCHAR(100) — NOT NULL
  • latitude — DECIMAL(10,7)
  • longitude — DECIMAL(10,7)
  • created_at — DATETIME — NOT NULL

tip_comments

  • id — BIGINT — Primary key — NOT NULL
  • tip_id — BIGINT — Foreign key → tips.id — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • parent_comment_id — BIGINT — Foreign key → tip_comments.id
  • content — TEXT — NOT NULL
  • status — VARCHAR(20) — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

tip_images

  • id — BIGINT — Primary key — NOT NULL
  • tip_id — BIGINT — Foreign key → tips.id — NOT NULL
  • image_url — VARCHAR(1000) — NOT NULL
  • sort_order — INT — NOT NULL
  • created_at — DATETIME — NOT NULL

tip_reactions

  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • tip_id — BIGINT — Foreign key → tips.id — NOT NULL
  • reaction_type — VARCHAR(20) — NOT NULL — helpful, inaccurate
  • created_at — DATETIME — NOT NULL

tip_scraps

  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • tip_id — BIGINT — Foreign key → tips.id — NOT NULL
  • created_at — DATETIME — NOT NULL

tips

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • place_id — BIGINT — Foreign key → places.id — NOT NULL
  • category_id — BIGINT — Foreign key → categories.id
  • title — VARCHAR(100) — NOT NULL
  • content — TEXT — NOT NULL
  • tip_type — VARCHAR(30) — NOT NULL — general, price, warning, discount, recommendation, job
  • price — INT
  • visited_at — DATE
  • status — VARCHAR(20) — NOT NULL — draft, published, hidden, deleted
  • is_sponsored — BOOLEAN — NOT NULL
  • view_count — INT — NOT NULL
  • scrap_count — INT — NOT NULL
  • helpful_count — INT — NOT NULL
  • comment_count — INT — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

trust_score_events

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL — 점수가 변경되는 사용자
  • source_user_id — BIGINT — Foreign key → users.id — 점수 변경을 유발한 사용자
  • event_type — VARCHAR(30) — NOT NULL — tip_helpful, tip_inaccurate, report_accepted, school_verified, admin_adjustment
  • reference_type — VARCHAR(20) — tip, comment, report
  • reference_id — BIGINT
  • score_delta — DECIMAL(5, 2) — NOT NULL
  • reason — VARCHAR(255)
  • created_at — DATETIME — NOT NULL

user_follows

  • follower_id — BIGINT — Foreign key → users.id — NOT NULL
  • following_id — BIGINT — Foreign key → users.id — NOT NULL
  • created_at — DATETIME — NOT NULL

users

  • id — BIGINT — Primary key — NOT NULL
  • school_id — BIGINT — Foreign key → schools.id
  • email — VARCHAR(255) — NOT NULL
  • password_hash — VARCHAR(255) — NOT NULL
  • nickname — VARCHAR(30) — NOT NULL
  • profile_image_url — VARCHAR(1000)
  • is_school_verified — BOOLEAN — NOT NULL
  • trust_score — DECIMAL(5, 2) — NOT NULL
  • status — VARCHAR(20) — NOT NULL — active, suspended, deleted
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL