Skip to content
Open
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
Empty file added .github/workflows/cd.yml
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
4 changes: 4 additions & 0 deletions src/main/java/flipnote/group/domain/model/BaseEntity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package flipnote.group.domain.model;

public abstract class BaseEntity {
}
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file added src/main/proto/group.proto
Empty file.
1 change: 0 additions & 1 deletion src/main/resources/application.properties

This file was deleted.

46 changes: 46 additions & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
spring:
application:
name: flipnote

datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: ${SPRING_DATASOURCE_URL}
username: ${SPRING_DATASOURCE_USERNAME}
password: ${SPRING_DATASOURCE_PASSWORD}

jpa:
open-in-view: false
hibernate:
ddl-auto: update

Comment on lines +11 to +15
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 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 to none for 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 course create / create-drop) — Hibernate explicitly notes update is 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.

Suggested change
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.

data:
redis:
host: ${SPRING_DATA_REDIS_HOST}
password: ${SPRING_DATA_REDIS_PASSWORD:}
port: ${SPRING_DATA_REDIS_PORT}


cloud:
aws:
bucket: ${S3_BUCKET_NAME}
region: ${S3_BUCKET_REGION}
credentials:
access-key: ${S3_ACCESS_KEY}
secret-key: ${S3_SECRET_KEY}
stack:
auto: false


image-clean:
batch-size: 300
orphan-grace-minutes: 10

image:
default:
user: https://flipnote-bucket.s3.ap-northeast-2.amazonaws.com/image/default/user.png
group: https://flipnote-bucket.s3.ap-northeast-2.amazonaws.com/image/default/group.png
cardSet: https://flipnote-bucket.s3.ap-northeast-2.amazonaws.com/image/default/cardset.png

logging:
level:
flipnote.image: DEBUG
29 changes: 29 additions & 0 deletions src/test/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
spring:
datasource:
url: jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1
driver-class-name: org.h2.Driver
username: sa
password:

jpa:
hibernate:
ddl-auto: create-drop

properties:
hibernate:
show_sql: true
format_sql: true
use_sql_comments: true

data:
redis:
host: localhost
port: 6379

cloud:
aws:
region: dummy_bucket_region
credentials:
access-key: dummy_access_key
secret-key: dummy_secret_key
bucket: dummy_bucket