게시판구현하기
테이블 (4)
게시판 (Post)
- no (post_no) — BigInt — 기본 키 — NOT NULL — PK
- categoryNo (category_no) — BigInt — 외래 키 → 카테고리.no — NOT NULL
- userNo (user_no) — BigInt — 외래 키 → 유저.no — NOT NULL
- title — varchar(64) — NOT NULL — 게시판 제목
- content — text — NOT NULL — 게시판 내용
- view — BigInt — NOT NULL — 조회수
- createdDate (created_date) — timestamp — NOT NULL — 게시판 생성 날짜
- lastModifiedDate (lastModified_date) — timestamp — NOT NULL — 게시판 수정 날짜, 처음에는 생성날짜랑 같게
- deletedDate (deleted_date) — timestamp — 게시판 삭제 날짜, Soft Delete
댓글 (Comment)
- no (comment_no) — BigInt — 기본 키 — NOT NULL — PK
- userNo (user_no) — BigInt — 외래 키 → 유저.no — NOT NULL
- postNo (post_no) — BigInt — 외래 키 → 게시판.no — NOT NULL — PK
- content — text — NOT NULL
- createdDate (created_date) — timestamp — NOT NULL
- lastModifiedDate (lastModified_date) — timestamp — NOT NULL
- deletedDate (deleted_date) — timestamp
유저 (Users)
- no (user_no) — BigInt — 기본 키 — NOT NULL
- id — varchar(20) — NOT NULL
- password — varchar(60) — NOT NULL
- name — varchar(20) — NOT NULL
- createdDate (created_date) — timestamp — NOT NULL
- lastModifiedDate (lastModified_date) — timestamp — NOT NULL
- deletedDate (deleted_date) — timestamp
카테고리 (Category)
- no (category_no) — BigInt — 기본 키 — NOT NULL
- name — varchar(64) — NOT NULL — unique