forked from codesquad-members-2022/todo-list
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 특정 사용자에 대한 card만 가져올 수 있도록 user 테이블 추가 - 기존 board 테이블을 없애고, card에서 board 이름을 가지도록 변경 - "remove"를 통해 제거 여부를 표시하도록 변경
- Loading branch information
1 parent
eec3fbd
commit 6cf0e3f
Showing
3 changed files
with
41 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,38 @@ | ||
DROP TABLE IF EXISTS `user`; | ||
|
||
create TABLE `user` ( | ||
userId VARCHAR(255) NOT NULL PRIMARY KEY, | ||
password VARCHAR(255) NOT NULL, | ||
name VARCHAR(255) NOT NULL, | ||
email VARCHAR(255) NOT NULL | ||
CREATE TABLE `user` ( | ||
`userId` VARCHAR(50) NOT NULL, | ||
`password` VARCHAR(50) NOT NULL, | ||
`remove` TINYINT(1) NOT NULL DEFAULT 0, | ||
PRIMARY KEY (`userId`) | ||
); | ||
|
||
DROP TABLE IF EXISTS article; | ||
DROP TABLE IF EXISTS `card`; | ||
|
||
create TABLE article ( | ||
id BIGINT(8) NOT NULL AUTO_INCREMENT PRIMARY KEY, | ||
writer VARCHAR(255) NOT NULL, | ||
title VARCHAR(255) NOT NULL, | ||
contents VARCHAR(255) NOT NULL | ||
CREATE TABLE `card` ( | ||
`cardId` INT NOT NULL AUTO_INCREMENT, | ||
`userId` VARCHAR(50) NOT NULL, | ||
`cardTitle` VARCHAR(50) NOT NULL, | ||
`cardContent` VARCHAR(255) NOT NULL, | ||
`boardName` VARCHAR(50) NOT NULL, | ||
`internalOrder` INT NOT NULL, | ||
`addDateTime` TIMESTAMP NOT NULL, | ||
`remove` TINYINT(1) NOT NULL DEFAULT 0, | ||
PRIMARY KEY (`cardId`), | ||
FOREIGN KEY (`userId`) | ||
REFERENCES `user` (`userId`) | ||
ON UPDATE CASCADE | ||
); | ||
|
||
DROP TABLE IF EXISTS `history`; | ||
|
||
CREATE TABLE `history` ( | ||
`historyId` INT NOT NULL AUTO_INCREMENT, | ||
`userId` VARCHAR(50) NOT NULL, | ||
`actionHistory` VARCHAR(100) NOT NULL, | ||
`actionTime` TIMESTAMP NOT NULL, | ||
PRIMARY KEY (`historyId`), | ||
FOREIGN KEY (`userId`) | ||
REFERENCES `user` (`userId`) | ||
ON UPDATE CASCADE | ||
); |