-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #72 from codestates-seb/feature/NEM-248-서버운영환경설정
Feature/nem-248 서버운영환경설정(application-server.yml, schema 추가)
- Loading branch information
Showing
23 changed files
with
218 additions
and
127 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
6 changes: 0 additions & 6 deletions
6
server/src/main/java/com/noterror/app/api/entity/member/Roles.java
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 |
---|---|---|
|
@@ -11,6 +11,7 @@ | |
@Builder | ||
@Getter | ||
@Setter | ||
@Table(name = "order_product") | ||
public class OrderProduct { | ||
|
||
@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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,35 @@ | ||
spring: | ||
sql: | ||
init: | ||
# schema-locations: | ||
# - classpath*:db/mysql/member/roles_schema.sql | ||
# - classpath*:db/mysql/cart_detail/cart_detail_schema.sql | ||
# - classpath*:db/mysql/cart/cart_schema.sql | ||
# - classpath*:db/mysql/order_product/order_product_schema.sql | ||
# - classpath*:db/mysql/order/order_schema.sql | ||
# - classpath*:db/mysql/member/member_schema.sql | ||
# - classpath*:db/mysql/product/product_schema.sql | ||
# - classpath*:db/mysql/vegetarian/vegetarian_schema.sql | ||
# - classpath*:db/mysql/constraint.sql | ||
data-locations: | ||
- classpath*:db/mysql/data.sql | ||
encoding: UTF-8 | ||
mode: always | ||
|
||
jpa: | ||
database: mysql | ||
open-in-view: false | ||
hibernate: | ||
ddl-auto: create | ||
#defer-datasource-initialization: true | ||
show-sql: false | ||
defer-datasource-initialization: true | ||
|
||
datasource: | ||
password: seb39main1 | ||
url: jdbc:mysql://database-3.cn22higluw0t.ap-northeast-2.rds.amazonaws.com:13306/test | ||
username: admin | ||
password: ${RDS_PASSWORD} | ||
url: ${RDS_URL} | ||
username: ${RDS_USERNAME} | ||
driver-class-name: com.mysql.cj.jdbc.Driver | ||
|
||
sql: | ||
init: | ||
mode: always | ||
|
||
|
||
logging: | ||
level: | ||
org: | ||
|
@@ -23,11 +38,11 @@ logging: | |
jpa: DEBUG | ||
|
||
jwt: | ||
access-token-expiration-minutes: 60 | ||
access-token-expiration-minutes: 30 | ||
refresh-token-expiration-minutes: 420 | ||
key: | ||
secret: noterrorvegetarian7894431123412341234qwerjameshongyunAAgErt | ||
secret: ${JWT_SECRET_KEY} | ||
|
||
mail: | ||
address: | ||
admin: [email protected] | ||
admin: ${ADMIN_MAIL} |
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 |
---|---|---|
|
@@ -28,11 +28,11 @@ logging: | |
jpa: DEBUG | ||
|
||
jwt: | ||
access-token-expiration-minutes: 60 | ||
access-token-expiration-minutes: 150 | ||
refresh-token-expiration-minutes: 420 | ||
key: | ||
secret: noterrorvegetarian7894431123412341234qwerjameshongyunAAgErt | ||
secret: ${JWT_SECRET_KEY} | ||
|
||
mail: | ||
address: | ||
admin: [email protected] | ||
admin: ${ADMIN_MAIL} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
DROP TABLE IF EXISTS cart CASCADE; | ||
|
||
create table cart ( | ||
cart_id bigint, | ||
create_date datetime(6), | ||
edit_date datetime(6), | ||
member_id bigint | ||
) engine=InnoDB; |
8 changes: 8 additions & 0 deletions
8
server/src/main/resources/db/mysql/cart_detail/cart_detail_schema.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 @@ | ||
DROP TABLE IF EXISTS cart_detail CASCADE; | ||
|
||
create table cart_detail ( | ||
cart_detail_id bigint, | ||
purchase_quantity integer, | ||
cart_id bigint, | ||
product_id bigint | ||
) engine=InnoDB; |
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,81 @@ | ||
-- PK | ||
|
||
ALTER TABLE member | ||
ADD CONSTRAINT PK_MEMBER PRIMARY KEY (member_id); | ||
|
||
ALTER TABLE orders | ||
ADD CONSTRAINT PK_ORDERS PRIMARY KEY (orders_id); | ||
|
||
ALTER TABLE cart | ||
ADD CONSTRAINT PK_CART PRIMARY KEY (cart_id); | ||
|
||
ALTER TABLE cart_detail | ||
ADD CONSTRAINT PK_CART_DETAIL PRIMARY KEY (cart_detail_id); | ||
|
||
ALTER TABLE order_product | ||
ADD CONSTRAINT PK_ORDER_PRODUCT PRIMARY KEY (orders_product_id); | ||
|
||
ALTER TABLE product | ||
ADD CONSTRAINT PK_PRODUCT PRIMARY KEY (product_id); | ||
|
||
ALTER TABLE category | ||
ADD CONSTRAINT PK_CATEGORY PRIMARY KEY (category_id); | ||
|
||
ALTER TABLE vegetarian | ||
ADD CONSTRAINT PK_VEGETARIAN PRIMARY KEY (vegetarian_type); | ||
|
||
|
||
-- AUTO INCREMENT | ||
|
||
ALTER TABLE member | ||
MODIFY member_id BIGINT NOT NULL AUTO_INCREMENT FIRST; | ||
|
||
ALTER TABLE orders | ||
MODIFY orders_id BIGINT NOT NULL AUTO_INCREMENT FIRST; | ||
|
||
ALTER TABLE cart | ||
MODIFY cart_id BIGINT NOT NULL AUTO_INCREMENT FIRST; | ||
|
||
ALTER TABLE cart_detail | ||
MODIFY cart_detail_id BIGINT NOT NULL AUTO_INCREMENT FIRST; | ||
|
||
ALTER TABLE order_product | ||
MODIFY order_product_id BIGINT NOT NULL AUTO_INCREMENT FIRST; | ||
|
||
ALTER TABLE product | ||
MODIFY product_id BIGINT NOT NULL AUTO_INCREMENT FIRST; | ||
|
||
ALTER TABLE category | ||
MODIFY category_id BIGINT NOT NULL AUTO_INCREMENT FIRST; | ||
|
||
|
||
-- FK | ||
|
||
ALTER TABLE cart | ||
ADD FOREIGN KEY (member_id) REFERENCES member (member_id); | ||
|
||
ALTER TABLE cart_detail | ||
ADD FOREIGN KEY (cart_id) REFERENCES cart (cart_id); | ||
|
||
ALTER TABLE cart_detail | ||
ADD FOREIGN KEY (product_id) REFERENCES product (proudct_id); | ||
|
||
ALTER TABLE orders | ||
ADD FOREIGN KEY (member_id) REFERENCES member (member_id); | ||
|
||
ALTER TABLE order_product | ||
ADD FOREIGN KEY (orders_id) REFERENCES orders (orders_id); | ||
|
||
ALTER TABLE order_product | ||
ADD FOREIGN KEY (product_id) REFERENCES product (product_id); | ||
|
||
ALTER TABLE roles | ||
ADD FOREIGN KEY (member_id) REFERENCES member (member_id); | ||
|
||
ALTER TABLE category | ||
ADD FOREIGN KEY (parent_category_id) REFERENCES category (category_id); | ||
|
||
-- UNIQUE | ||
ALTER TABLE member | ||
ADD UNIQUE (email); | ||
-- INDEX |
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
16 changes: 16 additions & 0 deletions
16
server/src/main/resources/db/mysql/member/member_schema.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,16 @@ | ||
|
||
DROP TABLE IF EXISTS member CASCADE; | ||
|
||
create table member ( | ||
member_id bigint, | ||
create_date datetime(6), | ||
edit_date datetime(6), | ||
city varchar(255), | ||
detail_address varchar(255), | ||
zip_code varchar(255), | ||
email varchar(255), | ||
member_name varchar(255), | ||
password varchar(255), | ||
phone varchar(255), | ||
vegetarian_type varchar(255) | ||
) engine=InnoDB; |
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,6 @@ | ||
DROP TABLE IF EXISTS roles CASCADE; | ||
|
||
CREATE TABLE roles ( | ||
member_id bigint, | ||
roles varchar(255) | ||
) engine=InnoDB; |
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,9 @@ | ||
DROP TABLE IF EXISTS orders CASCADE; | ||
|
||
create table orders ( | ||
orders_id bigint, | ||
create_date datetime(6), | ||
edit_date datetime(6), | ||
orders_status varchar(255), | ||
member_id bigint | ||
) engine=InnoDB; |
9 changes: 9 additions & 0 deletions
9
server/src/main/resources/db/mysql/order_product/order_product_schema.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,9 @@ | ||
DROP TABLE IF EXISTS order_product CASCADE; | ||
|
||
create table order_product ( | ||
orders_product_id bigint, | ||
orders_price integer, | ||
orders_quantity integer, | ||
orders_id bigint, | ||
product_id bigint | ||
) engine=InnoDB; |
Oops, something went wrong.