Conversation
Walkthrough새로운 추상 기본 클래스 BaseEntity를 도메인 모델에 추가하고, Spring Boot 설정 파일(application.yml)을 메인 및 테스트 환경용으로 작성했습니다. 기존 properties에서 애플리케이션 이름 설정을 제거하고 YAML 형식으로 통합했습니다. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/main/resources/application.yml`:
- Around line 11-15: Change the default JPA hibernate ddl setting from update to
a safe default (e.g., jpa.hibernate.ddl-auto: validate or none) and remove any
hard-coded update in the main application.yml; instead allow environment
override via SPRING_JPA_HIBERNATE_DDL_AUTO so development can opt into update,
ensuring production uses validate/none by default. Locate the
jpa.hibernate.ddl-auto property in the configuration and replace its value
accordingly, and document/ensure environments set
SPRING_JPA_HIBERNATE_DDL_AUTO=update only for dev.
🧹 Nitpick comments (1)
src/main/java/flipnote/group/domain/model/BaseEntity.java (1)
1-4: 엔티티를 확장할 때@MappedSuperclass적용 필요현재 비어있는 추상 클래스로 사용할 경우 문제없습니다. 다만 이 클래스를 상속받는 엔티티가 생기고 공통 ID/감사 필드 등을 추가할 때는
@MappedSuperclass어노테이션을 적용해야 JPA가 올바르게 처리합니다. Spring Boot 4.0.1은 Jakarta EE를 사용하므로jakarta.persistence.MappedSuperclass를 임포트하면 됩니다.
| jpa: | ||
| open-in-view: false | ||
| hibernate: | ||
| ddl-auto: update | ||
|
|
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
Spring Boot spring.jpa.hibernate.ddl-auto production environment recommended value 2025
💡 Result:
For a production Spring Boot app, the recommended approach is to disable Hibernate’s automatic schema changes and manage schema evolution with migration tools (Flyway/Liquibase).
Recommended value (most common for prod):
spring.jpa.hibernate.ddl-auto=none— Hibernate performs no schema generation/updates; Spring Boot also defaults tononefor non-embedded (“real”) databases unless you set it explicitly. [1]
Sometimes used in prod for safety checks:
spring.jpa.hibernate.ddl-auto=validate— verifies the schema matches your entities at startup, but does not modify the DB. [1]
Avoid in production:
update(and of coursecreate/create-drop) — Hibernate explicitly notesupdateis not suitable for production; use schema migration tools instead. [2]
Sources: Spring Boot reference docs on ddl-auto values/defaults [1]; Hibernate best practices on schema management [2].
운영 환경에서 ddl-auto: update는 위험 — 환경변수로 분리 필수
운영 환경의 update 설정은 의도치 않은 스키마 변경을 야기할 수 있습니다. 기본값을 validate(또는 none)로 설정하고, 개발 환경에서만 update로 오버라이드하는 구성으로 변경하세요.
권장 변경
jpa:
open-in-view: false
hibernate:
- ddl-auto: update
+ ddl-auto: ${SPRING_JPA_HIBERNATE_DDL_AUTO:validate}개발 환경에서는 SPRING_JPA_HIBERNATE_DDL_AUTO=update로 설정하면 됩니다.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| jpa: | |
| open-in-view: false | |
| hibernate: | |
| ddl-auto: update | |
| jpa: | |
| open-in-view: false | |
| hibernate: | |
| ddl-auto: ${SPRING_JPA_HIBERNATE_DDL_AUTO:validate} | |
🤖 Prompt for AI Agents
In `@src/main/resources/application.yml` around lines 11 - 15, Change the default
JPA hibernate ddl setting from update to a safe default (e.g.,
jpa.hibernate.ddl-auto: validate or none) and remove any hard-coded update in
the main application.yml; instead allow environment override via
SPRING_JPA_HIBERNATE_DDL_AUTO so development can opt into update, ensuring
production uses validate/none by default. Locate the jpa.hibernate.ddl-auto
property in the configuration and replace its value accordingly, and
document/ensure environments set SPRING_JPA_HIBERNATE_DDL_AUTO=update only for
dev.
Summary by CodeRabbit
릴리스 노트
설정
개선