sns(kal)

테이블 (9)

게시글-해시태그(부가) (posthashtag)

  • post_id — int — 외래 키 → 게시물.post_id — NOT NULL — post 식별자
  • 해시태그 id (hashtag_id) — int — 외래 키 → 해시태그(부가).해시태그 id — NOT NULL — auto_increment

게시물 (posts)

  • post_id — int — 기본 키 — NOT NULL — post 식별자
  • user_id — int — 외래 키 → 회원정보.user_id — NOT NULL
  • photo — STRING(100) — NOT NULL — value에 경로
  • 내용 (content) — text
  • 만든시간 (create_time) — DATE — NOT NULL
  • 수정시간 (update_time) — DATE

댓글 (Comment)

  • 댓글id (cm_id) — int — 기본 키 — NOT NULL — comment 식별자
  • 게시물id (post_id) — int — 외래 키 → 게시물.post_id — NOT NULL — post 식별자
  • 유저id (user_id) — int — 외래 키 → 회원정보.user_id — NOT NULL — 댓글 작성자
  • content — text — NOT NULL — 댓글 내용
  • 작성시간 (create_time) — DATE — NOT NULL — 댓글 생성일
  • 댓글 깊이 (depth_no) — int — NOT NULL — 댓글 깊이
  • 댓글 순서 (order_no) — int — NOT NULL — 댓글 순서
  • 부모 원댓글 (parent_id) — int — NOT NULL — 자기 자신 혹은 댓글이라면 원글의 cm_id

북마크 (Bookmark)

  • user_id — int — 외래 키 → 회원정보.user_id — NOT NULL
  • 게시물id (post_id) — int — 외래 키 → 게시물.post_id — NOT NULL — Post의 post_id

신고 (Report)

  • post_id — int — 외래 키 → 게시물.post_id — NOT NULL — 신고당한 게시글
  • user_id — int — 외래 키 → 회원정보.user_id — NOT NULL — 신고한 유저
  • 신고시간 (report_time) — DATE — NOT NULL — 신고 시간

좋아요 (Likes)

  • 회원정보id (user_id) — int — 외래 키 → 회원정보.user_id — NOT NULL
  • 게시물id (post_id) — int — 외래 키 → 게시물.post_id — NOT NULL

팔로우(부가) (follow)

  • 나를 누른사람 (follower_id) — INTEGER — 외래 키 → 회원정보.user_id — NOT NULL — user_id (나를 누른사람)
  • 내가 누른사람 (following_id) — INTEGER — 외래 키 → 회원정보.user_id — NOT NULL — user_id(내가 누른사람)

해시태그(부가) (hashtags)

  • 해시태그 id (hashtag_id) — int — 기본 키 — NOT NULL — auto_increment
  • 태그 (tag) — STRING(30) — NOT NULL

회원정보 (users)

  • user_id — int — 기본 키 — NOT NULL — auto_increment
  • 이메일 (email) — STRING(30) — 기본 키 — NOT NULL — unique
  • 이름 (name) — STRING(30) — NOT NULL
  • 비밀번호 (password) — text — NOT NULL
  • 프로필사진 (profile_pic) — text
  • 권한 (auth) — integer — NOT NULL — 관리자1, 일반유저2(default 2)
  • 가입경로 (Field) — enum — NOT NULL — local, kakao, naver