SellingCommunity_ERD

Tables (13)

City (city)

  • 시번호 (city_id) — NOT NULL — Primary key
  • 도번호 (province_id) — NOT NULL — Foreign key → Province.도번호
  • 시이름 (city_name) — NOT NULL

Comment (comment)

  • 댓글번호 (comment_id) — NOT NULL — Primary key
  • 유저번호 (user_id) — NOT NULL — Foreign key → Users.유저번호
  • 게시물번호 (community_post_id) — NOT NULL — Foreign key → CommunityPost.게시물번호
  • 유저번호 (user_id2) — NOT NULL — Foreign key → CommunityPost.유저번호
  • 부모댓글번호 (parent_comment_id) — NULL
  • 내용 (content) — NOT NULL
  • 작성일자 (created_at) — NOT NULL
  • 수정일자 (updated_at) — NULL

CommunityLike (community_like)

  • 좋아요번호 (community_like_id) — NOT NULL — Primary key — NOT NULL
  • 게시물번호 (community_post_id2) — NOT NULL — Foreign key → CommunityPost.게시물번호
  • 유저번호 (user_id) — NOT NULL — Foreign key → CommunityPost.유저번호
  • 생성일자 (created_at) — NOT NULL

CommunityPost (community_post)

  • 게시물번호 (community_post_id) — NOT NULL — Primary key
  • 유저번호 (user_id) — NOT NULL — Foreign key → Users.유저번호
  • 제목 (title) — NOT NULL
  • 내용 (content) — NOT NULL
  • 사진 (image) — NULL
  • 작성일자 (created_at) — NOT NULL
  • 수정일자 (updated_at) — NULL

CommunityPostHashtag (community_post_hashtag)

  • 게시물해시태그번호 (community_post_hashtag_id) — NOT NULL — Primary key — NOT NULL
  • 게시물번호 (community_post_id) — NOT NULL — Foreign key → CommunityPost.게시물번호
  • 유저번호 (user_id) — NOT NULL — Foreign key → CommunityPost.유저번호
  • 해시태그번호 (hashtag_id) — NOT NULL — Foreign key → Hashtag.해시태그번호 — NOT NULL

District (district)

  • 구번호 (district_id) — NOT NULL — Primary key
  • 도번호 (province_id2) — NOT NULL — Foreign key → City.도번호
  • 시번호 (city_id) — NOT NULL — Foreign key → City.시번호
  • 구이름 (district_name) — NOT NULL

Follow (follow)

  • 팔로우번호 (follow_id) — NOT NULL — Primary key — NOT NULL
  • 유저번호 (user_id) — NOT NULL — Foreign key → Users.유저번호
  • 유저번호 (user_id2) — NOT NULL — Foreign key → Users.유저번호
  • 팔로워유저번호 (follower_id) — NOT NULL
  • 팔로잉유저번호 (following_id) — NOT NULL
  • 생성일자 (created_at) — NOT NULL

Hashtag (hashtag)

  • 해시태그번호 (hashtag_id) — NOT NULL — Primary key — NOT NULL
  • 해시태그명 (name) — NOT NULL

Province (province)

  • 도번호 (province_id) — NOT NULL — Primary key
  • 도이름 (province_name) — NOT NULL

Purchase (purchase)

  • 구매번호 (purchase_id) — NOT NULL — Primary key — NOT NULL
  • 판매글번호 (sale_post_id) — NOT NULL — Foreign key → SalePost.판매글번호 — NOT NULL
  • 유저번호 (user_id) — NOT NULL — Foreign key → SalePost.유저번호
  • 유저번호 (user_id2) — NOT NULL — Foreign key → Users.유저번호
  • 구매일자 (purchased_at) — NOT NULL
  • 구매수량 (quantity) — NOT NULL

SalePost (sale_post)

  • 판매글번호 (sale_post_id) — NOT NULL — Primary key — NOT NULL
  • 유저번호 (user_id) — NOT NULL — Foreign key → Users.유저번호
  • 제목 (title) — NOT NULL
  • 내용 (content) — NOT NULL
  • 가격 (price) — NOT NULL
  • 사진 (image) — NULL
  • 판매상태 (status) — NOT NULL
  • 작성일자 (created_at) — NOT NULL
  • 수정일자 (updated_at) — NULL

UserTag (user_tag)

  • 유저태그번호 (user_tag_id) — NOT NULL — Primary key — NOT NULL
  • 게시물번호 (community_post_id) — NOT NULL — Foreign key → CommunityPost.게시물번호
  • 유저번호 (user_id2) — NOT NULL — Foreign key → CommunityPost.유저번호
  • 유저번호 (user_id3) — NOT NULL — Foreign key → Users.유저번호
  • 태그된유저번호 (tagged_user_id) — NOT NULL

Users (users)

  • 유저번호 (user_id) — NOT NULL — Primary key
  • 구번호 (district_id) — NOT NULL
  • 회원아이디 (username) — NOT NULL
  • 비밀번호 (password) — NOT NULL
  • 이름 (name) — NOT NULL
  • 나이 (age) — NOT NULL
  • 상세주소 (detail_address) — NOT NULL