게시판 CRUD

테이블 (3)

게시물 (post)

  • id (Key) — 기본 키 — NOT NULL
  • user_id (유저아이디) — 외래 키 → 사용자.id — NOT NULL
  • title (제목)
  • content (내용)
  • created_at (생성시간)

댓글 (comment)

  • id (Key) — 기본 키 — NOT NULL
  • post_id (게시물아이디) — 외래 키 → 게시물.id — NOT NULL
  • parent_comment_id (부모댓글 아이디) — 외래 키 → 댓글.id — NOT NULL
  • user_id (유저아이디) — 외래 키 → 사용자.id — NOT NULL
  • content (댓글내용)
  • created_at (생성시간)

사용자 (users)

  • id (Key) — 기본 키 — NOT NULL
  • username (사용자 이름)
  • password (비밀번호)
  • created_at (생성시간)