ERD2

Tables (5)

Answer

  • q_id (Key) — bigint — Foreign key → Question.q_id — NOT NULL — 같은 Chat의 max(q_id) + 1
  • chat_id (Key2) — bigint — Foreign key → Question.chat_id — NOT NULL — 같은 User의 max(chat_id) + 1
  • user_id — bigint — Foreign key → Question.user_id — NOT NULL — Auto Increment
  • content — varchar(250) — NOT NULL — User 입력 질의
  • created_at — datetime — NOT NULL — 응답 완료한 시간
  • image — varchar(100) — 모델 생성 이미지 저장 경로

Chat

  • chat_id (Key) — bigint — Primary key — NOT NULL — 같은 User의 max(chat_id) + 1
  • user_id — bigint — Foreign key → User.user_id — NOT NULL — Auto Increment
  • created_at — datetime — NOT NULL — 채팅방 개설 시간
  • title — varchar(15) — NOT NULL — Question Content의 첫 15글자

Gallery

  • gallery_id (Key) — bigint — Primary key — NOT NULL — 같은 User의 max(gallery_id) + 1
  • user_id — bigint — Foreign key → User.user_id — NOT NULL — Auto Increment
  • image (Field) — varchar(100) — NOT NULL — 갤러리 이미지 저장 경로
  • Field2 — 예비 필드용

Question

  • q_id (Key) — bigint — Primary key — NOT NULL — 같은 Chat의 max(q_id) + 1
  • chat_id (Key2) — bigint — Foreign key → Chat.chat_id — NOT NULL — 같은 User의 max(chat_id) + 1
  • user_id — bigint — Foreign key → Chat.user_id — NOT NULL — Auto Increment
  • content — varchar(150) — NOT NULL — User 입력 질의
  • created_at — datetime — NOT NULL — 질의한 시간
  • image — varchar(100) — 유저 첨부 이미지 저장 경로

User (user)

  • user_id — bigint — Primary key — NOT NULL — Auto Increment
  • email — varchar(30) — NOT NULL — 로그인 시 ID, UNIQUE
  • password — varchar(15) — NOT NULL — 로그인 시 PW
  • nickname — varchar(10) — NOT NULL — 닉네임, UNIQUE
  • profile — varchar(100) — NOT NULL — 프로필 사진 저장 경로
  • Field — 예비 필드용