From 01390b850350f89aa4c86f98a513453e672ec746 Mon Sep 17 00:00:00 2001 From: ragdoll Date: Fri, 12 Jun 2020 04:46:48 +0900 Subject: [PATCH] =?UTF-8?q?[BE/#17]=20Chore=20:=20DB=20=EC=8A=A4=ED=82=A4?= =?UTF-8?q?=EB=A7=88=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit user 테이블에 이미지 url 컬럼 추가 - avatar_url 테이블명 변경 - issue_has_label RDS 사용으로 전환 --- BE/.gitignore | 3 + BE/src/main/resources/application.properties | 8 +- BE/src/main/resources/schema.sql | 131 ++++++++++--------- 3 files changed, 73 insertions(+), 69 deletions(-) diff --git a/BE/.gitignore b/BE/.gitignore index fb4ac6a..b0edcbe 100644 --- a/BE/.gitignore +++ b/BE/.gitignore @@ -102,3 +102,6 @@ gradle-app.setting **/build/ # End of https://www.toptal.com/developers/gitignore/api/java,windows,macos,gradle + +# Secret Properties +application-secret.properties diff --git a/BE/src/main/resources/application.properties b/BE/src/main/resources/application.properties index dd05933..d488951 100644 --- a/BE/src/main/resources/application.properties +++ b/BE/src/main/resources/application.properties @@ -1,8 +1,8 @@ -spring.mvc.hiddenmethod.filter.enabled=true +#spring.mvc.hiddenmethod.filter.enabled=true # logback level 설정 -logging.level.org.springframework=info; -logging.level.sql=info; +#logging.level.org.springframework=info; +#logging.level.sql=info; ## ec2 mySQL 연결 #spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver @@ -22,5 +22,5 @@ logging.level.sql=info; #spring.datasource.data=classpath:schema.sql #spring.datasource.initialization-mode=embedded -# application.properties +#application.properties spring.profiles.active=secret diff --git a/BE/src/main/resources/schema.sql b/BE/src/main/resources/schema.sql index e2414a0..104242d 100644 --- a/BE/src/main/resources/schema.sql +++ b/BE/src/main/resources/schema.sql @@ -1,65 +1,66 @@ -CREATE TABLE user ( - id BIGINT AUTO_INCREMENT, - name VARCHAR(128), - email VARCHAR(128), - github_id BIGINT, - created_date_time DATETIME, - PRIMARY KEY (id) -); - -CREATE TABLE milestone ( - id INT AUTO_INCREMENT, - title VARCHAR(128), - description VARCHAR(2048), - due_date DATE, - created_date_time DATETIME, - updated_date_time DATETIME, - PRIMARY KEY (id) -); - -CREATE TABLE issue ( - id BIGINT AUTO_INCREMENT, - title VARCHAR(128), - created_date_time DATETIME, - is_opened BOOLEAN, - user_id BIGINT, - milestone_id INT, - PRIMARY KEY (id), - FOREIGN KEY (user_id) REFERENCES user (id), - FOREIGN KEY (milestone_id) REFERENCES milestone (id) -); - -CREATE TABLE label ( - id INT, - name VARCHAR(128), - description VARCHAR(512), - hex_code VARCHAR(64), - PRIMARY KEY (id) -); - -CREATE TABLE label_has_issue ( - label_id INT, - issue_id BIGINT, - FOREIGN KEY (label_id) REFERENCES label (id), - FOREIGN KEY (issue_id) REFERENCES issue (id) -); - -CREATE TABLE assignee ( - id INT AUTO_INCREMENT, - issue_id BIGINT, - user_id BIGINT, - PRIMARY KEY (id), - FOREIGN KEY (issue_id) REFERENCES issue (id), - FOREIGN KEY (user_id) REFERENCES user (id) -); - -CREATE TABLE comment ( - id BIGINT AUTO_INCREMENT, - description VARCHAR(2048), - created_date_time DATETIME, - issue_id BIGINT, - user_id BIGINT, - PRIMARY KEY (id), - FOREIGN KEY (issue_id) REFERENCES issue (id), - FOREIGN KEY (user_id) REFERENCES user (id) -); \ No newline at end of file +-- CREATE TABLE IF NOT EXISTS user ( +-- id BIGINT AUTO_INCREMENT, +-- name VARCHAR(128), +-- email VARCHAR(128), +-- github_id BIGINT, +-- avatar_url VARCHAR(256), +-- created_date_time DATETIME, +-- PRIMARY KEY (id) +-- ); +-- +-- CREATE TABLE IF NOT EXISTS milestone ( +-- id INT AUTO_INCREMENT, +-- title VARCHAR(128), +-- description VARCHAR(2048), +-- due_date DATE, +-- created_date_time DATETIME, +-- updated_date_time DATETIME, +-- PRIMARY KEY (id) +-- ); +-- +-- CREATE TABLE IF NOT EXISTS issue ( +-- id BIGINT AUTO_INCREMENT, +-- title VARCHAR(128), +-- created_date_time DATETIME, +-- is_opened BOOLEAN, +-- user_id BIGINT, +-- milestone_id INT, +-- PRIMARY KEY (id), +-- FOREIGN KEY (user_id) REFERENCES user (id), +-- FOREIGN KEY (milestone_id) REFERENCES milestone (id) +-- ); +-- +-- CREATE TABLE IF NOT EXISTS label ( +-- id INT AUTO_INCREMENT, +-- name VARCHAR(128), +-- description VARCHAR(512), +-- hex_code VARCHAR(64), +-- PRIMARY KEY (id) +-- ); +-- +-- CREATE TABLE IF NOT EXISTS issue_has_label ( +-- label_id INT, +-- issue_id BIGINT, +-- FOREIGN KEY (label_id) REFERENCES label (id), +-- FOREIGN KEY (issue_id) REFERENCES issue (id) +-- ); +-- +-- CREATE TABLE IF NOT EXISTS assignee ( +-- id INT AUTO_INCREMENT, +-- issue_id BIGINT, +-- user_id BIGINT, +-- PRIMARY KEY (id), +-- FOREIGN KEY (issue_id) REFERENCES issue (id), +-- FOREIGN KEY (user_id) REFERENCES user (id) +-- ); +-- +-- CREATE TABLE IF NOT EXISTS comment ( +-- id BIGINT AUTO_INCREMENT, +-- description VARCHAR(2048), +-- created_date_time DATETIME, +-- issue_id BIGINT, +-- user_id BIGINT, +-- PRIMARY KEY (id), +-- FOREIGN KEY (issue_id) REFERENCES issue (id), +-- FOREIGN KEY (user_id) REFERENCES user (id) +-- );