diff --git a/webapp/backend/ddl/create-tables.sql b/webapp/backend/ddl/create-tables.sql index a3fd8f2012a8d44ce0065a21587cdb0efda8f005..1cc2f0e4176fae86346693d25f5a2c470dab7e0f 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`