Community Project BE

테이블 (4)

게시글 (Post)

  • 게시글 아이디 (post_id) — int (auto_increment) — 기본 키 — NOT NULL
  • 유저 아이디 (user_id) — int (auto_increment) — 외래 키 → 유저.유저 아이디 — NOT NULL — Auto increse
  • 제목 (title) — VARCHAR(26)
  • 내용 (content) — TEXT
  • 게시글 이미지 (post_image) — VARCHAR(255)
  • 게시글 작성시간 (create_at) — TIMESTAMP
  • 좋아요 수 (likes) — int
  • 조회수 (views) — int
  • 댓글 수 (comments) — int

댓글 (Comment)

  • 댓글 아이디 (comment_id) — int (auto_increment) — 기본 키 — NOT NULL — Auto increse
  • 게시글 아이디 (post_id) — int (auto_increment) — 외래 키 → 게시글.게시글 아이디 — NOT NULL
  • 댓글 작성자 아이디 (commenter_id) — int (auto_increment) — 외래 키 → 유저.유저 아이디 — NOT NULL — Auto increse
  • 댓글 내용 (comment_text) — TEXT
  • 댓글 작성시간 (create_at) — TIMESTAMP

유저 (User)

  • 유저 아이디 (user_id) — int (auto_increment) — 기본 키 — NOT NULL — Auto increse
  • 이메일 (email) — VARCHAR(50) — UNIQUE
  • 비밀번호 (password) — VARCHAR(255) — HASH값 들어감
  • 닉네임 (nickname) — VARCHAR(10)
  • 프로필 사진 (profile_image) — VARCHAR(255) — NOT NULL

좋아요 (PostLike)

  • 게시글 아이디 (post_id) — int (auto_increment) — 외래 키 → 게시글.게시글 아이디 — NOT NULL
  • 유저 아이디 (user_id) — int (auto_increment) — 외래 키 → 유저.유저 아이디 — NOT NULL — Auto increse