From ad32dacc5cbab911b65df8b4ab44b2062cd4a5c2 Mon Sep 17 00:00:00 2001 From: YuJin <you5463@ajou.ac.kr> Date: Sun, 8 Dec 2024 13:15:13 +0900 Subject: [PATCH] fix: update Comment table to replace DEFAULT CURRENT_DATE with DEFAULT... --- webapp/backend/ddl/create-tables.sql | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/webapp/backend/ddl/create-tables.sql b/webapp/backend/ddl/create-tables.sql index a3fd8f2..1cc2f0e 100644 --- a/webapp/backend/ddl/create-tables.sql +++ b/webapp/backend/ddl/create-tables.sql @@ -121,17 +121,18 @@ CREATE TABLE `Post` DROP TABLE IF EXISTS `Comment`; CREATE TABLE `Comment` ( - `commentID` INT NOT NULL, - `userID` INT NOT NULL, - `postID` INT NOT NULL, - `content` TEXT NULL, - `commentDate` DATE NULL DEFAULT CURRENT_DATE, + `commentID` INT NOT NULL AUTO_INCREMENT, + `userID` INT NOT NULL, + `postID` INT NOT NULL, + `content` TEXT NULL, + `commentDate` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`commentID`), FOREIGN KEY (`userID`) REFERENCES `User` (`userID`), FOREIGN KEY (`postID`) REFERENCES `Post` (`postID`), INDEX `idx_comment_date` (`commentDate`) ); + -- UserCrew 테이블 DROP TABLE IF EXISTS `UserCrew`; CREATE TABLE `UserCrew` -- GitLab