Skip to content
Snippets Groups Projects
Commit 3768d7df authored by YuJin's avatar YuJin
Browse files

Merge branch 'jin' into 'main'

fix: update Comment table to replace DEFAULT CURRENT_DATE with DEFAULT...

See merge request !44
parents 743a8bd6 ad32dacc
Branches
No related tags found
1 merge request!44fix: update Comment table to replace DEFAULT CURRENT_DATE with DEFAULT...
...@@ -121,17 +121,18 @@ CREATE TABLE `Post` ...@@ -121,17 +121,18 @@ CREATE TABLE `Post`
DROP TABLE IF EXISTS `Comment`; DROP TABLE IF EXISTS `Comment`;
CREATE TABLE `Comment` CREATE TABLE `Comment`
( (
`commentID` INT NOT NULL, `commentID` INT NOT NULL AUTO_INCREMENT,
`userID` INT NOT NULL, `userID` INT NOT NULL,
`postID` INT NOT NULL, `postID` INT NOT NULL,
`content` TEXT NULL, `content` TEXT NULL,
`commentDate` DATE NULL DEFAULT CURRENT_DATE, `commentDate` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`commentID`), PRIMARY KEY (`commentID`),
FOREIGN KEY (`userID`) REFERENCES `User` (`userID`), FOREIGN KEY (`userID`) REFERENCES `User` (`userID`),
FOREIGN KEY (`postID`) REFERENCES `Post` (`postID`), FOREIGN KEY (`postID`) REFERENCES `Post` (`postID`),
INDEX `idx_comment_date` (`commentDate`) INDEX `idx_comment_date` (`commentDate`)
); );
-- UserCrew 테이블 -- UserCrew 테이블
DROP TABLE IF EXISTS `UserCrew`; DROP TABLE IF EXISTS `UserCrew`;
CREATE TABLE `UserCrew` CREATE TABLE `UserCrew`
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment