practice-database

테이블 (11)

categories

  • id — int — 기본 키 — NOT NULL
  • name — string — NOT NULL — 카테고리 이름

follows

  • id — int — 기본 키 — NOT NULL
  • user_id — int — 외래 키 → users.id — NOT NULL — 사용자 id
  • follow_id (id3) — int — 외래 키 → users.id — NOT NULL — 팔로우하는 사용자 id

hashtags

  • id — int — 기본 키 — NOT NULL
  • name — string — NOT NULL — 해시태그 이름

likes

  • id — int — 기본 키 — NOT NULL
  • user_id — int — 외래 키 → users.id — NOT NULL — 작성자
  • post_id — int — 외래 키 → posts.id — NOT NULL — 게시글

post_hashtags

  • id — int — 기본 키 — NOT NULL
  • post_id — int — 외래 키 → posts.id — NOT NULL — 게시글
  • hashtag_id — int — 외래 키 → hashtags.id — NOT NULL — 해시태그

posts

  • id — int — 기본 키 — NOT NULL
  • user_id — int — 외래 키 → users.id — NOT NULL — 작성자
  • category_id — int — 외래 키 → categories.id — NOT NULL — 카테고리
  • created_at — datetime — NOT NULL — 작성 시간
  • title — string — NOT NULL — 제목
  • content — string — 내용
  • count — int — NOT NULL — 조회수

reports (Untitled8)

  • id — int — 기본 키 — NOT NULL
  • post_id — int — 외래 키 → posts.id — NOT NULL — 게시글
  • user_id — int — 외래 키 → users.id — NOT NULL — 신고자
  • reason — string — NOT NULL — 신고 사유

users

  • id — int — 기본 키
  • name — string — NOT NULL — 이름
  • email — string — NOT NULL — 이메일
  • password — str — NOT NULL — 비밀번호
  • age — int — 나이

배우 (actors)

  • id — 기본 키 — NOT NULL
  • 이름 (name) — str — NOT NULL

영화 (movies)

  • id — int — 기본 키 — NOT NULL
  • 제목 (title) — str

출연 배우 (movies_actors)

  • id — int — 기본 키 — NOT NULL
  • 배우 id (actor_id) — int — 외래 키 → 배우.id — NOT NULL
  • 영화 id (movie_id) — int — 외래 키 → 영화.id — NOT NULL