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

Refactor/53 #54

Merged
merged 2 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 2 additions & 6 deletions .github/workflows/backend-ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: CI
name: PicTalk dev CI

on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
Expand All @@ -25,7 +21,7 @@ jobs:
- name: Set up JDK 17 (Amazon Corretto)
uses: actions/setup-java@v4
with:
# distribution: 'corretto' # 올바른 배포판 이름
# distribution: 'corretto' # 올바른 배포판 이름
distribution: 'temurin'
java-version: '17'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dev_deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: UMC Dev CI/CD # workflow 이름
name: PicTalk dev CD # workflow 이름

on: # 이벤트 설정
pull_request:
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spring:

jpa:
hibernate:
ddl-auto: create-drop
ddl-auto: update
show-sql: true
properties:
hibernate:

Choose a reason for hiding this comment

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

코드에서 잘못된 부분이나 수정이 필요한 부분, 그리고 리팩토링할 수 있는 부분을 검토한 결과는 다음과 같습니다:

  1. DDL Auto 설정 변경:

    • ddl-auto: create-drop은 개발 환경에서 테스트할 때 유용하지만, 프로덕션 환경에서는 데이터가 잃어버릴 수 있습니다. update로 바뀌었으나, 만약 운영 환경에서는 별도로 데이터 마이그레이션을 관리하는 것이 좋습니다. 따라서, 실제 프로덕션 환경에서는 none으로 설정하고, Liquibase나 Flyway와 같은 도구를 사용하여 데이터베이스 스키마 마이그레이션을 관리하는 것을 추천합니다.
  2. show-sql:

    • show-sql: true는 SQL 쿼리를 콘솔에 출력하는데 유용할 수 있으나, 프로덕션 환경에서는 성능 문제나 보안상의 이유로 false로 설정하는 것이 좋습니다. 필요한 경우 로깅 프레임워크를 통해 로그 레벨을 조정할 수 있습니다.
  3. Indentation 및 코드 포맷팅:

    • properties 아래의 인덴트가 올바르지 않습니다. YAML 문법에서는 계층 구조에 따라 들여쓰기가 중요하므로, 올바르게 맞춰줘야 합니다.

이러한 점들을 보완하여 다음과 같이 수정할 수 있습니다:

spring:
  jpa:
    hibernate:
      ddl-auto: none # 프로덕션 환경에서는 none으로 설정
    show-sql: false # 프로덕션 환경에서는 false로 설정
    properties:
      hibernate:
        # 필요 시 hibernate의 추가 속성 설정

추가적인 개선 사항으로, hibernate에 필요한 속성이나 동작을 명시적으로 추가하여, 설정 파일의 가독성을 높이거나 명확하게 하는 것도 좋은 방법입니다.

Expand Down
Loading