Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BE] 기본 프로파일에서 DB를 MySQL을 H2로 변경 #102

Merged
merged 2 commits into from
Jul 24, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions server/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
spring:
datasource:
url: jdbc:mysql://localhost:3306/haengdong
username: root
password: 1234
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:h2:mem:database
driver-class-name: org.h2.Driver
username: sa
password:

h2:
console:
enabled: true
path: /h2-console

jpa:
hibernate:
ddl-auto: none
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
ddl-auto: none
ddl-auto: create

Copy link
Contributor Author

Choose a reason for hiding this comment

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

none으로 설정한 이유는 다음과 같습니다.

  • 해당 옵션은 디폴트로 다른 yml 설정에 전파됩니다.
  • 로컬에서 실행할 때 개발자가 의식적으로 create로 수정하는 것이 미연의 사고를 방지할 수 있지 않을까요?
  • dev.yml에 none을 설정해서 덮어쓰는 방법도 있을 것 같습니다.

Copy link
Contributor

Choose a reason for hiding this comment

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

dev.yml에 none을 설정해서 덮어쓰는 방법도 있을 것 같습니다.

이 방법을 의도해서 말했습니다. 로컬에서는 create 되어야 할 것 같아서요.

properties:
hibernate:
dialect: org.hibernate.dialect.MySQL8Dialect
Copy link
Contributor

Choose a reason for hiding this comment

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

이 부분은 application-dev.yml에 없는 내용이라 application-dev.yml 에 추가해서 덮어 써야할 것 같습니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

설정 깃헙 이곳에 업데이트했으니, 참고 부탁드립니다~

format_sql: true
format_sql: true
show-sql: true

cors:
Expand Down
Loading