-
Notifications
You must be signed in to change notification settings - Fork 3
[#2] mySQL DB 설정 #9
Conversation
jjeda
commented
Sep 9, 2019
- Local 환경 세팅
- ddl-auto = create 추가
- 개발 환경에서만
- show-sql & format_sql 추가
- 의도된 query가 날아가는지 확인
- Local 환경 세팅 - ddl-auto = create 추가 - show-sql & format_sql 추가
@@ -1 +1,9 @@ | |||
spring.datasource.url=jdbc:mysql://localhost:3306/mall |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[팁] Spring boot2에서는 hikari cp가 기본 connection pool인데요.
이 히카리풀이 엄청 빠릅니다. 한번 검색해보시는것도 좋을 것 같습니다
|
||
# 개발할 때만 table 관리를 편하게 하기위해 ddl-auto = create | ||
spring.jpa.hibernate.ddl-auto=create |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
개발시에만 마이그레이션을 하려고 하시는군요. 이제 찾았는데 이는 test/resources로 빼는 것이 좋을 것 같습니다~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
만약 테스트가 아닌 로컬개발용이라면 아래처럼 main/resources/application-default.properties로 빼시는 것도 좋아보입니다.
# 개발할 때만 table 관리를 편하게 하기위해 ddl-auto = create | ||
spring.jpa.hibernate.ddl-auto=create | ||
|
||
spring.jpa.show-sql=true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 옵션은 로컬 개발시에만 사용하려는 것으로 보이는데요. 로컬 개발시에는 application-default.properties로 따로 관리하시는 것이 좋습니다.
spring profile을 검색해보시면 좋을 것 같습니다.
- Local 개발용 application-defalut.properties 설정 - schema.sql 추가