Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERD #38

Open
walterkor opened this issue Jul 29, 2021 · 0 comments
Open

ERD #38

walterkor opened this issue Jul 29, 2021 · 0 comments

Comments

@walterkor
Copy link
Contributor

CREATE TABLE t_user(
iuser INT UNSIGNED PRIMARY KEY AUTO_INCREMENT COMMENT '회원번호',
email VARCHAR(50) UNIQUE NOT NULL COMMENT '이메일',
pw VARCHAR(100) NOT NULL COMMENT '비밀번호',
nm VARCHAR(5) NOT NULL COMMENT '회원이름',
nick VARCHAR(8) NOT NULL COMMENT '닉네임',
tel CHAR(13) COMMENT '연락처',
authCd CHAR(5) COMMENT '회원가입 인증코드, null이면 인증받은 상태, 값이 있으면 인증해야 되는 상태',
regdt DATETIME DEFAULT NOW() COMMENT '가입일자',
INDEX idx_auth_cd (authCd)
);

CREATE TABLE t_board(
iboard INT UNSIGNED PRIMARY KEY AUTO_INCREMENT COMMENT '게시물번호',
provider VARCHAR(50) NOT NULL COMMENT '게시판 구분',
iuser INT UNSIGNED COMMENT '회원번호',
title VARCHAR(300) NOT NULL COMMENT '게시물 제목',
ctnt VARCHAR(4000) NOT NULL COMMENT '게시물 내용',
regdt DATETIME DEFAULT NOW() COMMENT '작성 날짜',

FOREIGN KEY (iuser) REFERENCES t_user (iuser)
);

CREATE TABLE t_cmt(
icmt INT UNSIGNED PRIMARY KEY AUTO_INCREMENT COMMENT '댓글번호',
iuser INT UNSIGNED COMMENT '회원번호',
iboard INT UNSIGNED COMMENT '게시물번호',
cmt VARCHAR(2000) NOT NULL COMMENT '댓글내용',
regdt DATETIME DEFAULT NOW() COMMENT '작성 날짜',
FOREIGN KEY (iuser) REFERENCES t_user (iuser),
FOREIGN KEY (iboard) REFERENCES t_board (iboard)
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant