forked from woowacourse-teams/2024-cruru
-
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.
chore-be: flyway 적용 (woowacourse-teams#444)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Kwoun Ki Ho <[email protected]> Co-authored-by: Do Yeop Kim <[email protected]>
- Loading branch information
1 parent
b4a0123
commit cac525a
Showing
19 changed files
with
246 additions
and
32 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
54 changes: 54 additions & 0 deletions
54
backend/src/main/resources/db/migration/V1_1__init_constraints.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,54 @@ | ||
ALTER TABLE answer | ||
ADD CONSTRAINT fk_answer_to_applicant | ||
FOREIGN KEY (applicant_id) | ||
REFERENCES applicant(applicant_id); | ||
|
||
ALTER TABLE answer | ||
ADD CONSTRAINT fk_answer_to_question | ||
FOREIGN KEY (question_id) | ||
REFERENCES question(question_id); | ||
|
||
ALTER TABLE applicant | ||
ADD CONSTRAINT fk_applicant_to_process | ||
FOREIGN KEY (process_id) | ||
REFERENCES process(process_id); | ||
|
||
ALTER TABLE apply_form | ||
ADD CONSTRAINT fk_apply_form_to_dashboard | ||
FOREIGN KEY (dashboard_id) | ||
REFERENCES dashboard(dashboard_id); | ||
|
||
ALTER TABLE choice | ||
ADD CONSTRAINT fk_choice_to_question | ||
FOREIGN KEY (question_id) | ||
REFERENCES question(question_id); | ||
|
||
ALTER TABLE club | ||
ADD CONSTRAINT fk_club_to_member | ||
FOREIGN KEY (member_id) | ||
REFERENCES member(member_id); | ||
|
||
ALTER TABLE dashboard | ||
ADD CONSTRAINT fk_dashboard_to_club | ||
FOREIGN KEY (club_id) | ||
REFERENCES club(club_id); | ||
|
||
ALTER TABLE evaluation | ||
ADD CONSTRAINT fk_evaluation_to_applicant | ||
FOREIGN KEY (applicant_id) | ||
REFERENCES applicant(applicant_id); | ||
|
||
ALTER TABLE evaluation | ||
ADD CONSTRAINT fk_evaluation_to_process | ||
FOREIGN KEY (process_id) | ||
REFERENCES process(process_id); | ||
|
||
ALTER TABLE process | ||
ADD CONSTRAINT fk_process_to_dashboard | ||
FOREIGN KEY (dashboard_id) | ||
REFERENCES dashboard(dashboard_id); | ||
|
||
ALTER TABLE question | ||
ADD CONSTRAINT fk_question_to_apply_form | ||
FOREIGN KEY (apply_form_id) | ||
REFERENCES apply_form(apply_form_id); |
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,125 @@ | ||
CREATE TABLE answer | ||
( | ||
answer_id BIGINT NOT NULL AUTO_INCREMENT, | ||
applicant_id BIGINT NOT NULL, | ||
question_id BIGINT NOT NULL, | ||
content TEXT, | ||
PRIMARY KEY (answer_id) | ||
) ENGINE = InnoDB | ||
DEFAULT CHARSET = utf8mb4 | ||
COLLATE = utf8mb4_0900_ai_ci; | ||
|
||
CREATE TABLE applicant | ||
( | ||
applicant_id BIGINT NOT NULL AUTO_INCREMENT, | ||
created_date DATETIME(6), | ||
process_id BIGINT NOT NULL, | ||
updated_date DATETIME(6), | ||
email VARCHAR(255), | ||
name VARCHAR(255), | ||
phone VARCHAR(255), | ||
state VARCHAR(255), | ||
PRIMARY KEY (applicant_id) | ||
) ENGINE = InnoDB | ||
DEFAULT CHARSET = utf8mb4 | ||
COLLATE = utf8mb4_0900_ai_ci; | ||
|
||
CREATE TABLE apply_form | ||
( | ||
apply_form_id BIGINT NOT NULL AUTO_INCREMENT, | ||
created_date DATETIME(6), | ||
dashboard_id BIGINT NOT NULL, | ||
end_date DATETIME(6), | ||
start_date DATETIME(6), | ||
updated_date DATETIME(6), | ||
description TEXT, | ||
title VARCHAR(1023), | ||
url VARCHAR(1023), | ||
PRIMARY KEY (apply_form_id) | ||
) ENGINE = InnoDB | ||
DEFAULT CHARSET = utf8mb4 | ||
COLLATE = utf8mb4_0900_ai_ci; | ||
|
||
CREATE TABLE choice | ||
( | ||
choice_id BIGINT NOT NULL AUTO_INCREMENT, | ||
sequence INTEGER, | ||
question_id BIGINT NOT NULL, | ||
content VARCHAR(1023), | ||
PRIMARY KEY (choice_id) | ||
) ENGINE = InnoDB | ||
DEFAULT CHARSET = utf8mb4 | ||
COLLATE = utf8mb4_0900_ai_ci; | ||
|
||
CREATE TABLE club | ||
( | ||
club_id BIGINT NOT NULL AUTO_INCREMENT, | ||
member_id BIGINT NOT NULL, | ||
name VARCHAR(1023), | ||
PRIMARY KEY (club_id) | ||
) ENGINE = InnoDB | ||
DEFAULT CHARSET = utf8mb4 | ||
COLLATE = utf8mb4_0900_ai_ci; | ||
|
||
CREATE TABLE dashboard | ||
( | ||
dashboard_id BIGINT NOT NULL AUTO_INCREMENT, | ||
club_id BIGINT NOT NULL, | ||
PRIMARY KEY (dashboard_id) | ||
) ENGINE = InnoDB | ||
DEFAULT CHARSET = utf8mb4 | ||
COLLATE = utf8mb4_0900_ai_ci; | ||
|
||
CREATE TABLE evaluation | ||
( | ||
evaluation_id BIGINT NOT NULL AUTO_INCREMENT, | ||
score INTEGER, | ||
applicant_id BIGINT NOT NULL, | ||
created_date DATETIME(6), | ||
process_id BIGINT NOT NULL, | ||
updated_date DATETIME(6), | ||
content TEXT, | ||
PRIMARY KEY (evaluation_id) | ||
) ENGINE = InnoDB | ||
DEFAULT CHARSET = utf8mb4 | ||
COLLATE = utf8mb4_0900_ai_ci; | ||
|
||
CREATE TABLE member | ||
( | ||
member_id BIGINT NOT NULL AUTO_INCREMENT, | ||
created_date DATETIME(6), | ||
updated_date DATETIME(6), | ||
email VARCHAR(255) UNIQUE, | ||
password VARCHAR(2047), | ||
phone VARCHAR(511), | ||
role VARCHAR(255), | ||
PRIMARY KEY (member_id) | ||
) ENGINE = InnoDB | ||
DEFAULT CHARSET = utf8mb4 | ||
COLLATE = utf8mb4_0900_ai_ci; | ||
|
||
CREATE TABLE process | ||
( | ||
process_id BIGINT NOT NULL AUTO_INCREMENT, | ||
sequence INTEGER, | ||
dashboard_id BIGINT NOT NULL, | ||
description TEXT, | ||
name VARCHAR(255), | ||
PRIMARY KEY (process_id) | ||
) ENGINE = InnoDB | ||
DEFAULT CHARSET = utf8mb4 | ||
COLLATE = utf8mb4_0900_ai_ci; | ||
|
||
CREATE TABLE question | ||
( | ||
question_id BIGINT NOT NULL AUTO_INCREMENT, | ||
required BOOLEAN, | ||
sequence INTEGER, | ||
apply_form_id BIGINT NOT NULL, | ||
content TEXT, | ||
description TEXT, | ||
question_type VARCHAR(255), | ||
PRIMARY KEY (question_id) | ||
) ENGINE = InnoDB | ||
DEFAULT CHARSET = utf8mb4 | ||
COLLATE = utf8mb4_0900_ai_ci; |
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 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
Oops, something went wrong.