Skip to content

Commit

Permalink
[#1] 배포 환경에 따른 DB 접근 profile 분류
Browse files Browse the repository at this point in the history
  • Loading branch information
jun108059 committed Oct 16, 2021
1 parent 3aea62d commit 9525707
Showing 1 changed file with 54 additions and 7 deletions.
61 changes: 54 additions & 7 deletions common/src/main/resources/application-common.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,44 @@
spring:
profiles:
active: local

logging:
level: Debug

---
spring:
config:
activate:
on-profile: local
h2:
console:
enabled: true
path: /h2-console

datasource:
url: jdbc:h2:mem:testdb;MODE=mysql; # 접속 URL
username: yj_park # 사용자 이름 (로그인 시 사용)
password: 1234 # 사용자 암호 (로그인 시 사용)
driver-class-name: org.h2.Driver # h2 드라이버 설정
jpa:
hibernate:
ddl-auto: update
properties:
hibernate:
format_sql: true
show_sql: true
use_sql_comments: true

---
spring:
config:
activate:
on-profile: dev
datasource:
url: jdbc:mysql://db-lazy.cwn26ebdtrvp.ap-northeast-2.rds.amazonaws.com:3306/lazy_19th?useUnicode=true&serverTimezone=Asia/Seoul&characterEncoding=UTF-8
username: secret:)
password: secret:)
driver-class-name: com.mysql.cj.jdbc.Driver
username: *********
password: *********
# driver-class-name: com.mysql.cj.jdbc.Driver
jpa:
hibernate:
ddl-auto: none
Expand All @@ -17,7 +49,22 @@ spring:
show_sql: true
use_sql_comments: true

logging:
level: Debug

---
---
spring:
config:
activate:
on-profile: prod
datasource:
url: jdbc:mysql://db-lazy.cwn26ebdtrvp.ap-northeast-2.rds.amazonaws.com:3306/lazy_19th?useUnicode=true&serverTimezone=Asia/Seoul&characterEncoding=UTF-8
username: *********
password: *********
# driver-class-name: com.mysql.cj.jdbc.Driver
jpa:
hibernate:
ddl-auto: create
properties:
hibernate:
format_sql: true
dialect: org.hibernate.dialect.MySQL5InnoDBDialect
show_sql: true
use_sql_comments: true

0 comments on commit 9525707

Please sign in to comment.