-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
6 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,15 @@ | ||
# 수정 필요 | ||
|
||
CREATE TABLE `Page` ( | ||
`page_id` INT AUTO_INCREMENT NOT NULL, `title` VARCHAR(255) NOT NULL, `url` VARCHAR(2083) NOT NULL, `summary` TEXT NOT NULL, `created_at` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), `state` TINYINT NOT NULL DEFAULT 1 | ||
`page_id` INT AUTO_INCREMENT NOT NULL, `title` VARCHAR(255) NOT NULL, `url` VARCHAR(2083) NOT NULL, `summary` TEXT NOT NULL, `created_at` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), `state` TINYINT NOT NULL DEFAULT 1, PRIMARY KEY (`page_id`) | ||
); | ||
|
||
CREATE TABLE `User` ( | ||
`user_id` INT AUTO_INCREMENT NOT NULL, `auth_id` BIGINT NOT NULL, `email` VARCHAR(255) NOT NULL, `user_name` VARCHAR(255) NOT NULL, `created_at` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), `state` TINYINT NOT NULL DEFAULT 1, `access_token` VARCHAR(255) NULL, `token_type` VARCHAR(255) NULL, `expires_in` VARCHAR(255) NULL, `refresh_token` VARCHAR(255) NULL, `scope` VARCHAR(255) NULL, `id_token` VARCHAR(255) NULL | ||
`user_id` INT AUTO_INCREMENT NOT NULL, `auth_id` BIGINT NOT NULL, `email` VARCHAR(255) NOT NULL, `user_name` VARCHAR(255) NOT NULL, `created_at` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), `state` TINYINT NOT NULL DEFAULT 1, `access_token` VARCHAR(255) NULL, `token_type` VARCHAR(255) NULL, `expires_in` VARCHAR(255) NULL, `refresh_token` VARCHAR(255) NULL, `scope` VARCHAR(255) NULL, `id_token` VARCHAR(255) NULL, PRIMARY KEY (`user_id`) | ||
); | ||
|
||
CREATE TABLE `Bookmark` ( | ||
`bookmark_id` INT AUTO_INCREMENT NOT NULL, `page_id` INT NOT NULL, `user_id` INT NOT NULL, `created_at` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), `state` TINYINT NOT NULL DEFAULT 1 | ||
); | ||
|
||
CREATE TABLE `MDContent` ( | ||
`content_id` INT AUTO_INCREMENT NOT NULL, `user_id` INT NULL DEFAULT 0, `content` TEXT NOT NULL, `created_at` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), `updated_at` DATETIME(3) NOT NULL DEFAULT ON UPDATE CURRENT_TIMESTAMP(3), `state` TINYINT NOT NULL DEFAULT 1 | ||
`bookmark_id` INT AUTO_INCREMENT NOT NULL, `page_id` INT NOT NULL, `user_id` INT NOT NULL, `created_at` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), `state` TINYINT NOT NULL DEFAULT 1, PRIMARY KEY (`bookmark_id`), FOREIGN KEY (`page_id`) REFERENCES `Page` (`page_id`), FOREIGN KEY (`user_id`) REFERENCES `User` (`user_id`) | ||
); | ||
|
||
ALTER TABLE `Page` | ||
ADD CONSTRAINT `PK_PAGE` PRIMARY KEY (`page_id`); | ||
|
||
ALTER TABLE `User` | ||
ADD CONSTRAINT `PK_USER` PRIMARY KEY (`user_id`); | ||
|
||
ALTER TABLE `Bookmark` | ||
ADD CONSTRAINT `PK_BOOKMARK` PRIMARY KEY (`bookmark_id`); | ||
|
||
ALTER TABLE `MDContent` | ||
ADD CONSTRAINT `PK_MDCONTENT` PRIMARY KEY (`content_id`); | ||
CREATE TABLE `Content` ( | ||
`content_id` INT AUTO_INCREMENT NOT NULL, `user_id` INT NULL DEFAULT 0, `content` TEXT NOT NULL, `created_at` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), `updated_at` DATETIME(3) NOT NULL DEFAULT ON UPDATE CURRENT_TIMESTAMP(3), `state` TINYINT NOT NULL DEFAULT 1, PRIMARY KEY (`content_id`), FOREIGN KEY (`user_id`) REFERENCES `User` (`user_id`) | ||
); |