반응형
1. board
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
CREATE TABLE `board` (
`boardId` int(11) NOT NULL AUTO_INCREMENT,
`bUsername` varchar(10) DEFAULT NULL,
`bTitle` varchar(20) DEFAULT NULL,
`bContent` varchar(200) DEFAULT NULL,
`bDate` timestamp NULL DEFAULT NULL,
`bHit` int(11) DEFAULT NULL,
`bGroup` int(11) DEFAULT NULL,
`bIndent` int(11) DEFAULT NULL,
`bStep` int(11) DEFAULT NULL,
PRIMARY KEY (`boardId`),
KEY `board_ibfk_1` (`bUsername`),
CONSTRAINT `board_ibfk_1` FOREIGN KEY (`bUsername`) REFERENCES `boardmember` (`username`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=133 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
http://colorscripter.com/info#e" target="_blank" style="color:#e5e5e5text-decoration:none">Colored by Color Scripter
|
2. boardmember
1
2
3
4
5
6
7
8
9
10
11
12
|
CREATE TABLE `boardmember` (
`memberId` int(11) unsigned NOT NULL AUTO_INCREMENT,
`username` varchar(10) DEFAULT NULL,
`password` varchar(10) DEFAULT NULL,
`email` varchar(20) DEFAULT NULL,
`gender` varchar(2) DEFAULT NULL,
`joindate` datetime DEFAULT CURRENT_TIMESTAMP,
`birthday` datetime DEFAULT NULL,
PRIMARY KEY (`memberId`),
UNIQUE KEY `username` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
http://colorscripter.com/info#e" target="_blank" style="color:#e5e5e5text-decoration:none">Colored by Color Scripter
|
3. comment
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
CREATE TABLE `comment` (
`commentId` int(11) NOT NULL AUTO_INCREMENT,
`boardId` int(11) DEFAULT NULL,
`username` varchar(10) DEFAULT NULL,
`content` varchar(100) DEFAULT NULL,
`cLike` int(11) DEFAULT NULL,
`cGroup` int(11) DEFAULT NULL,
`cIndent` int(11) DEFAULT NULL,
`cStep` int(11) DEFAULT NULL,
`cDate` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`commentId`),
KEY `username` (`username`),
KEY `comment_ibfk_1` (`boardId`),
CONSTRAINT `comment_ibfk_1` FOREIGN KEY (`boardId`) REFERENCES `board` (`boardId`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `comment_ibfk_2` FOREIGN KEY (`username`) REFERENCES `boardmember` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
http://colorscripter.com/info#e" target="_blank" style="color:#e5e5e5text-decoration:none">Colored by Color Scripter
|
반응형
'IT > ETC' 카테고리의 다른 글
Algorithm time complexity (2) | 2019.12.01 |
---|---|
자바 메모리 구조 (0) | 2019.11.23 |
Various html (0) | 2019.11.14 |
Settings (0) | 2019.11.14 |
Controller (1) | 2019.11.14 |