Skip to content
This repository has been archived by the owner on Aug 13, 2022. It is now read-only.

[#2] mySQL DB 설정 #9

Merged
merged 3 commits into from
Sep 23, 2019
Merged

[#2] mySQL DB 설정 #9

merged 3 commits into from
Sep 23, 2019

Conversation

jjeda
Copy link
Collaborator

@jjeda jjeda commented Sep 9, 2019

  • Local 환경 세팅
  • ddl-auto = create 추가
    • 개발 환경에서만
  • show-sql & format_sql 추가
    • 의도된 query가 날아가는지 확인

- Local 환경 세팅
- ddl-auto = create 추가
- show-sql & format_sql 추가
@jjeda jjeda requested a review from f-lab-dev September 9, 2019 06:42
@jjeda jjeda self-assigned this Sep 9, 2019
@@ -1 +1,9 @@
spring.datasource.url=jdbc:mysql://localhost:3306/mall
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

개발시에만 마이그레이션을 하려고 하시는군요. 이제 찾았는데 이는 test/resources로 빼는 것이 좋을 것 같습니다~

Copy link
Member

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
Copy link
Member

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 추가
@jjeda jjeda merged commit d76a7e0 into feature/1 Sep 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants