Skip to content

Commit

Permalink
MySQL server: PR#79
Browse files Browse the repository at this point in the history
  • Loading branch information
Berygna committed Jun 23, 2024
1 parent d6fe02b commit 1f5e932
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions algofi-mysql/init/create_table.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ CREATE TABLE member (
login_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
created_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
);

/* filestorage table 생성 */
CREATE TABLE filestorage (
Expand All @@ -22,7 +22,7 @@ CREATE TABLE filestorage (
created_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_time TIMESTAMP,
FOREIGN KEY(member_id) REFERENCES member(member_id)
)CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
);

/* file table 생성 */
CREATE TABLE file (
Expand All @@ -36,7 +36,7 @@ CREATE TABLE file (
parent_id INT NULL,
FOREIGN KEY(file_storage_id) REFERENCES filestorage(file_storage_id),
FOREIGN KEY(parent_id) REFERENCES file(file_id) ON DELETE CASCADE
)CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
);

/* algorithmproblem table 생성 */
CREATE TABLE algorithmproblem (
Expand All @@ -45,13 +45,13 @@ CREATE TABLE algorithmproblem (
level VARCHAR(10) NOT NULL,
content TEXT,
recommend_time INT
)CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
);

/* chatroom table 생성 */
CREATE TABLE chatroom (
chatroom_id VARCHAR(36) PRIMARY KEY,
chatroom_name VARCHAR(100)
)CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
);

/* message table 생성 */
CREATE TABLE message (
Expand All @@ -63,7 +63,7 @@ CREATE TABLE message (
chatroom_id VARCHAR(36) NOT NULL,
FOREIGN KEY(sender_id) REFERENCES member(member_id),
FOREIGN KEY(chatroom_id) REFERENCES chatroom(chatroom_id)
)CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
);

/* member_chatroom table 생성 */
CREATE TABLE member_chatroom (
Expand All @@ -84,7 +84,7 @@ CREATE TABLE gameresult (
chatroom_id VARCHAR(36) NOT NULL,
FOREIGN KEY (algorithmproblem_id) REFERENCES algorithmproblem(algorithmproblem_id),
FOREIGN KEY (chatroom_id) REFERENCES chatroom(chatroom_id)
)CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
);

/* member_gameresult table 생성 */
CREATE TABLE member_gameresult (
Expand All @@ -101,4 +101,4 @@ CREATE TABLE testcase (
test_output VARCHAR(500),
algorithmproblem_id INT NOT NULL,
FOREIGN KEY(algorithmproblem_id) REFERENCES algorithmproblem(algorithmproblem_id)
)CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
);

0 comments on commit 1f5e932

Please sign in to comment.