forked from kookmin-sw/cap-template
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Fork/#125 flyway
- Loading branch information
Showing
9 changed files
with
120 additions
and
31 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
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
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
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
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
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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,89 @@ | ||
CREATE TABLE upload_file | ||
( | ||
file_id BIGINT AUTO_INCREMENT, | ||
origin_filename VARCHAR(255), | ||
stored_filename VARCHAR(255), | ||
PRIMARY KEY (file_id) | ||
); | ||
|
||
CREATE TABLE company | ||
( | ||
company_id BIGINT AUTO_INCREMENT, | ||
name VARCHAR(255), | ||
domain VARCHAR(255), | ||
bno VARCHAR(255), | ||
logo_file_id BIGINT, | ||
PRIMARY KEY (company_id), | ||
FOREIGN KEY (logo_file_id) REFERENCES upload_file (file_id) | ||
); | ||
|
||
CREATE TABLE user | ||
( | ||
user_id BIGINT AUTO_INCREMENT, | ||
login_id VARCHAR(255), | ||
kakao_id BIGINT, | ||
password VARCHAR(255), | ||
coffee_bean double default 46 not null, | ||
position tinyint default 0 null, | ||
email VARCHAR(255), | ||
nickname VARCHAR(255), | ||
phone VARCHAR(255), | ||
useruuid VARCHAR(255), | ||
device_token VARCHAR(255), | ||
introduction VARCHAR(255), | ||
company_id BIGINT, | ||
PRIMARY KEY (user_id), | ||
FOREIGN KEY (company_id) REFERENCES company (company_id) | ||
); | ||
|
||
CREATE TABLE company_request | ||
( | ||
company_request_id BIGINT AUTO_INCREMENT, | ||
user_id BIGINT, | ||
name VARCHAR(255), | ||
domain VARCHAR(255), | ||
bno VARCHAR(255), | ||
PRIMARY KEY (company_request_id), | ||
FOREIGN KEY (user_id) REFERENCES user (user_id) | ||
); | ||
|
||
CREATE TABLE chatroom | ||
( | ||
chatroom_id BIGINT AUTO_INCREMENT, | ||
PRIMARY KEY (chatroom_id) | ||
); | ||
|
||
CREATE TABLE message | ||
( | ||
message_id BIGINT AUTO_INCREMENT, | ||
chatroom_id BIGINT, | ||
sender_id BIGINT, | ||
content VARCHAR(255), | ||
created_at DATETIME(6), | ||
PRIMARY KEY (message_id), | ||
FOREIGN KEY (chatroom_id) REFERENCES chatroom (chatroom_id), | ||
FOREIGN KEY (sender_id) REFERENCES user (user_id) | ||
); | ||
|
||
CREATE TABLE user_chatroom | ||
( | ||
user_chatroom_id BIGINT AUTO_INCREMENT, | ||
user_id BIGINT, | ||
chatroom_id BIGINT, | ||
PRIMARY KEY (user_chatroom_id), | ||
FOREIGN KEY (user_id) REFERENCES user (user_id), | ||
FOREIGN KEY (chatroom_id) REFERENCES chatroom (chatroom_id) | ||
); | ||
|
||
CREATE TABLE review | ||
( | ||
review_id BIGINT AUTO_INCREMENT, | ||
comment VARCHAR(255), | ||
created_at DATETIME(6), | ||
rating INT, | ||
receiver_id BIGINT, | ||
sender_id BIGINT, | ||
PRIMARY KEY (review_id), | ||
FOREIGN KEY (receiver_id) REFERENCES user (user_id), | ||
FOREIGN KEY (sender_id) REFERENCES user (user_id) | ||
); |
8 changes: 8 additions & 0 deletions
8
backend/src/main/resources/db/migration/V2__company_seed_data.sql
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# company 테이블의 seed data (커리어한잔, 구글) insert | ||
INSERT INTO upload_file (file_id, origin_filename, stored_filename) | ||
VALUES (1, 'coffeechat-logo.png', 'coffeechat-logo.png'), | ||
(2, 'google-logo.png', 'google-logo.png'); | ||
|
||
INSERT INTO company (company_id, logo_file_id, bno, domain, name) | ||
VALUES (1, 1, '00000000000', 'coffeechat.com', '커리어 한잔'), | ||
(2, 2, '00000000000', 'gmail.com', 'google(구글)'); |