sns

Tables (8)

comments (댓글)

  • id — int — Primary key — NOT NULL — Auto Increament
  • 유저 아이디 (UserId) — int — Foreign key → users.id — NOT NULL — user 외래키
  • 게시물 아이디 (PostId) — int — Foreign key → posts.id — NOT NULL — posts 외래키
  • 내용 (content) — text — NOT NULL — comment 내용

follow (팔로우)

  • 팔로잉 유저 아이디 (FollowingId) — int — Foreign key → users.id — NOT NULL — user 외래키
  • 팔로우 유저 아이디 (FollowerId) — int — Foreign key → users.id — NOT NULL — user 외래키

hashtags (해쉬태그)

  • id — int — Primary key — NOT NULL — Auto Increament
  • 태그 이름 (name) — text — NOT NULL — 해쉬 태그

images (이미지)

  • id — int — Primary key — NOT NULL
  • 게시물 아이디 (PostId) — int — Foreign key → posts.id — NOT NULL — posts 외래키
  • 이미지 파일 (src) — varchar(200) — NOT NULL

like (좋아요)

  • 유저 아이디 (UserId) — int — Foreign key → users.id — NOT NULL — user 외래키
  • 게시물 아이디 (PostId) — int — Foreign key → posts.id — NOT NULL — posts 외래키

posthashtag (포스트 해쉬태그 관계)

  • 게시물 아이디 (PostId) — int — Foreign key → posts.id — NOT NULL — posts 외래키
  • 해쉬태그 아이디 (HashtagId) — int — Foreign key → hashtags.id — NOT NULL — hashtags 외래키

posts (포스트)

  • id — int — Primary key — NOT NULL — Auto Increament
  • 유저 아이디 (UserId) — int — Foreign key → users.id — NOT NULL — users 외래키
  • 리트윗 (RetWeetId) — int — Foreign key → posts.id — 다른 유저의 postId
  • 내용 (content) — text — NOT NULL — post 내용

users (유저)

  • id — int — Primary key — NOT NULL — Auto Increament
  • 이메일 (email) — varchar(40) — NOT NULL — 로그인 이메일
  • 비밀번호 (password) — varchar(100) — NOT NULL — 로그인 비밀번호
  • 닉네임 (nickname) — varchar(30) — NOT NULL — 사용자 닉네임