hanbit-project

Tables (4)

Article (게시글)

  • id (Key) — int — Primary key — NOT NULL
  • title (게시글 제목) — varchar(30) — NOT NULL
  • content (게시글 내용) — varchar(1000) — NOT NULL
  • commentCount (댓글 수) — int — NOT NULL
  • likeCount (좋아요 수) — int — NOT NULL
  • createdAt (게시글 생성일시) — datetime — NOT NULL
  • comments (댓글 목록) — Array — NOT NULL
  • userId (게시글 작성 유저의 id) — int — Foreign key → User.id — NOT NULL

Comment (댓글)

  • id (Key) — int — Primary key — NOT NULL
  • content (댓글 내용) — varchar(500) — NOT NULL
  • createdAt (댓글 작성 일시) — datetime — NOT NULL
  • updatedAt (댓글 수정 일시)
  • isDeleted (댓글 삭제 일시)
  • replies (댓글에 작성된 답글들) — Array — NOT NULL
  • userId (댓글을 작성한 유저의 id) — int — Foreign key → User.id — NOT NULL
  • articleId (댓글이 작성된 게시글의 id) — int — Foreign key → Article.id — NOT NULL
  • parentId (부모 댓글의 id) — int — Foreign key → Comment.id

Like (좋아요)

  • id (Key) — int — Primary key — NOT NULL
  • createdAt (좋아요 생성일시) — datetime — NOT NULL
  • userId (좋아요를 누른 유저의 id) — int — Foreign key → User.id — NOT NULL
  • commentId (좋아요를 누른 게시글의 id) — int — Foreign key → Comment.id — NOT NULL

User (유저)

  • id (Key) — int — Primary key — NOT NULL
  • userId (유저 아이디) — varchar — NOT NULL
  • password (유저 비밀번호) — varchar — NOT NULL
  • nickName (유저 별명) — varchar — NOT NULL
  • email (유저 이메일) — varchar — NOT NULL
  • createdAt (유저 생성일시) — datetime — NOT NULL
  • deletedAt (유저 탈퇴일시) — datetime — NOT NULL
  • articleList (유저가 작성한 게시글 목록) — Array