4th_erd_dosirak

Tables (9)

boards (게시판)

  • board_id (게시판 ID) — BIGINT — Primary key — NOT NULL
  • board_type (게시판 종류) — VARCHAR(50) — NOT NULL — 명예의전당, 이미지퀴즈용 / 나중에 공지, 자유?? (ENUM)
  • name (게시판 이름) — VARCHAR(100) — NOT NULL
  • created_at (생성일) — DATETIME

guesses (정답 맞추기)

  • guess_id (추측 ID) — BIGINT — Primary key — NOT NULL
  • round_id (라운드 ID) — BIGINT — Foreign key → rounds.round_id — NOT NULL — rounds.round_id
  • user_id (유저 ID) — BIGINT — Foreign key → users.user_id — NOT NULL — users.user_id
  • guess_text (입력한 단어) — VARCHAR(100) — NOT NULL
  • is_correct (정답 여부) — TINYINT(1) — NOT NULL — 0: 오답 / 1: 정답
  • created_at (추측 시각) — DATETIME

messages (메시지)

  • message_id (메시지 ID) — BIGINT — Primary key — NOT NULL
  • room_id (방 ID) — BIGINT — Foreign key → rooms.room_id — NOT NULL — rooms.room_id
  • user_id (유저 ID) — BIGINT — Foreign key → users.user_id — NOT NULL — users.user_id
  • content (내용) — VARCHAR(500) — NOT NULL
  • message_type (메시지 종류) — TINYINT — NOT NULL — 0: 채팅 / 1: 시스템 / 2: 정답 알림 (ENUM)
  • created_at (보낸 시각) — DATETIME

post_images (게시글 이미지 파일)

  • post_image_id (이미지 ID) — BIGINT — Primary key — NOT NULL
  • post_id (게시글 ID) — BIGINT — Foreign key → posts.post_id — NOT NULL — posts.post_id
  • image_url (이미지 경로) — VARCHAR(255) — NOT NULL
  • order_no (이미지 순서) — INT — NOT NULL — 게시글 내 이미지 순서 필요??

posts (게시글)

  • post_id (게시글 ID) — BIGINT — Primary key — NOT NULL
  • board_id (게시판 ID) — BIGINT — Foreign key → boards.board_id — NOT NULL — boards.board_id
  • user_id (유저 ID) — BIGINT — Foreign key → users.user_id — NOT NULL — users.user_id
  • title (제목) — VARCHAR(200) — NOT NULL
  • content (내용) — TEXT
  • like_count (좋아요 추천수) — INT — NOT NULL
  • created_at (작성일) — DATETIME
  • visibility (공개여부) — TINYINT — NOT NULL — 1: 공개 / 0: 비공개 (ENUM)

room_members (방 참가자)

  • room_member_id (ID) — BIGINT — Primary key — NOT NULL
  • room_id (방 ID) — BIGINT — Foreign key → rooms.room_id — NOT NULL — rooms.room_id
  • user_id (유저 ID) — BIGINT — Foreign key → users.user_id — NOT NULL — users.user_id
  • score (점수) — INT — NOT NULL — 해당 방 내 누적 점수
  • role (역할) — TINYINT — NOT NULL — 0: 플레이어 / 1: 방장 / 2: 관전자 (ENUM)
  • joined_at (입장시간) — DATETIME

rooms (게임방)

  • room_id (방 ID) — BIGINT — Primary key — NOT NULL
  • created_by (생성자) — BIGINT — Foreign key → users.user_id — NOT NULL — users.user_id
  • room_name (방 이름) — VARCHAR(100) — NOT NULL
  • max_players (최대인원) — INT — NOT NULL
  • status (상태) — TINYINT — NOT NULL — 0: 대기 / 1: 진행중 / 2: 종료 (ENUM)
  • created_at (생성일) — DATETIME

rounds (라운드)

  • round_id (라운드 ID) — BIGINT — Primary key — NOT NULL
  • room_id (방 ID) — BIGINT — Foreign key → rooms.room_id — NOT NULL — rooms.room_id
  • drawer_id (출제자) — BIGINT — Foreign key → users.user_id — NOT NULL — users.user_id
  • user_id (유저 ID) — BIGINT — Foreign key → rooms.created_by — NOT NULL
  • round_no (라운드 번호) — INT — NOT NULL
  • answer_word (정답 단어) — VARCHAR(100) — NOT NULL
  • image_url (이미지 경로) — VARCHAR(255) — 파일 기반
  • started_at (시작 시각) — DATETIME
  • ended_at (종료 시각) — DATETIME

users (유저)

  • user_id (유저 ID) — BIGINT — Primary key — NOT NULL
  • login_id (로그인 ID) — VARCHAR(50) — NOT NULL
  • nickname (닉네임) — VARCHAR(50) — NOT NULL
  • email (이메일) — VARCHAR(100) — NOT NULL
  • password (패스워드) — VARCHAR(255) — NOT NULL
  • create_at (생성일) — DATETIME — NOT NULL
  • last_login (마지막 로그인) — DATETIME