ERD

Tables (6)

artists

  • artist_id — int — Primary key — NOT NULL — 아티스트 고유 번호
  • artist_name — varchar(30) — NOT NULL — 아티스트 이름
  • artist_image_url — varchar(300) — 아티스트 사진/경로
  • created_at — datetime — NOT NULL — 등록일

chat_messages

  • message_id — int — Primary key — NOT NULL — 메시지 번호
  • room_id — int — NOT NULL — 채팅방 번호 FK(암묵적) -> chat_rooms.room_id
  • member_id — int — NOT NULL — 보낸 회원 번호 FK(암묵적) -> member.member_id
  • message — varchar(1000) — NOT NULL — 메시지 내용
  • sent_at — datetime — NOT NULL — 보낸 시간

chat_room_members

  • room_id — int — Primary key — NOT NULL — 채팅방 번호 FK(암묵적) -> chat_rooms.room_id
  • member_id — int — Primary key — NOT NULL — 회원 번호 FK(암묵적) -> member.member_id
  • join_at — datetime — NOT NULL — 입장 시간

chat_rooms

  • room_id — int — Primary key — NOT NULL — 채팅방 고유 번호
  • room_name — varchar(100) — NOT NULL — 방 이름
  • room_type — enum('artist','song') — NOT NULL — 채팅방 구분
  • target_id — int — NOT NULL — 채팅방 대상 번호(암묵적, room_type에 따라 artists.artist_id 또는 songs.song_id 참조)
  • theme_id — int — NOT NULL — 장르 번호 FK(암묵적) -> themes.theme_id
  • created_at — datetime — NOT NULL — 방 개설 일자

songs

  • song_id — int — Primary key — NOT NULL — 노래 고유 번호
  • artist_id — int — Foreign key → artists.artist_id — NOT NULL — 아티스트 고유 번호
  • song_title — varchar(50) — NOT NULL — 노래 이름
  • theme_id — int — NOT NULL — 장르 번호 FK(암묵적) -> themes.theme_id
  • album_image_url — varchar(300) — 최신 노래 앨범/이미지 경로
  • release_date — date — 최신 발매일

themes

  • theme_id — int — Primary key — NOT NULL — 장르 고유 번호
  • theme_name — varchar(50) — NOT NULL — 장르 이름
  • created_at — datetime — NOT NULL — 등록일