데이터베이스설계스터디 1주차

테이블 (4)

comments (Untitled3)

  • id (Key) — int — 기본 키 — NOT NULL
  • user_id (Key2) — int — 외래 키 → users.id — NOT NULL
  • post_id (Key3) — int — 외래 키 → posts.id — NOT NULL
  • content (Field) — string — NOT NULL
  • created_at (Field2) — datetime — NOT NULL
  • modified_at (Field3) — datetime
  • deleted_at (Field4) — datetime

likes (Untitled4)

  • id (Key) — 기본 키 — NOT NULL
  • user_id (Key2) — int — 외래 키 → users.id — NOT NULL
  • post_id (Key3) — int — 외래 키 → posts.id — NOT NULL
  • created_at (Field) — datetime — NOT NULL
  • modified_at (Field2) — datetime
  • deleted_at (Field3) — datetime

posts (Untitled2)

  • id (Key) — int — 기본 키 — NOT NULL
  • user_id (Key2) — int — 외래 키 → users.id — NOT NULL
  • title (Field) — string — NOT NULL
  • content (Field2) — string — NOT NULL
  • created_at (Field3) — datetime — NOT NULL
  • modified_at (Field4) — datetime
  • deleted_at (Field5) — datetime

users (Untitled)

  • id (Key) — int — 기본 키 — NOT NULL
  • username (Field) — string — NOT NULL
  • password (Field2) — string — NOT NULL
  • email (Field3) — string — NOT NULL
  • created_at (Field4) — datetime — NOT NULL
  • modified_at (Field5) — datetime
  • deleted_at (Field6) — datetime