Skip to content

Commit

Permalink
[BE/#17] Chore : DB 스키마 수정
Browse files Browse the repository at this point in the history
user 테이블에 이미지 url 컬럼 추가
- avatar_url

테이블명 변경
- issue_has_label

RDS 사용으로 전환
  • Loading branch information
MuseopKim committed Jun 11, 2020
1 parent 4bd8e07 commit 01390b8
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 69 deletions.
3 changes: 3 additions & 0 deletions BE/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 4 additions & 4 deletions BE/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
131 changes: 66 additions & 65 deletions BE/src/main/resources/schema.sql
Original file line number Diff line number Diff line change
@@ -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)
);
-- 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)
-- );

0 comments on commit 01390b8

Please sign in to comment.