Skip to content

Comments

chore: Flyway 설정을 통한 데이터베이스 스키마 관리 적용(#66)#68

Merged
chaiminwoo0223 merged 1 commit intodevelopfrom
chore/66
Aug 30, 2025
Merged

chore: Flyway 설정을 통한 데이터베이스 스키마 관리 적용(#66)#68
chaiminwoo0223 merged 1 commit intodevelopfrom
chore/66

Conversation

@chaiminwoo0223
Copy link
Contributor

@chaiminwoo0223 chaiminwoo0223 commented Aug 29, 2025

📌 작업 내용 및 특이사항

✅ 환경 설정

  • build.gradleFlyway 의존성 추가 (flyway-core, flyway-mysql)
  • application-local.yml, application-dev.yml, application-test.yml 환경 설정에서 spring.jpa.hibernate.ddl-auto: none으로 변경
  • application-prod.yml, application-dev.yml, application-test.yml 환경 설정에서 spring.jpa.open-in-view: false 추가
  • SQL 초기화 방지를 위해 application.yml 환경 설정에서 spring.sql.init.mode: never 추가

✅ Flyway 적용

  • Flyway 환경별 프로필 설정 추가 (prod, dev, local, test)
  • db/migration 패키지 추가
  • V1__create_tables.sql: member, trip, stamp, mission, study_log 등 테이블 생성 스크립트 작성

🌱 관련 이슈


🔍 참고사항(선택)

  • Flyway 마이그레이션은 파일 변경에 매우 민감합니다.
  • 공백, 들여쓰기, 주석 수정만 해도 checksum mismatch 에러가 발생할 수 있습니다.
  • 기존 마이그레이션은 절대 수정하지 말고, 변경은 모두 새로운 버전 파일(V2, V3, V4)로 관리해야 합니다.

📚 기타(선택)

* chore: local, dev, test 환경 설정에서 ddl-auto: none으로 변경
* chore: prod, dev, test 환경 설정에서 open-in-view: false 추가
* chore: build.gradle에 Flyway 의존성 추가
* chore: Flyway 환경별 프로필(prod/dev/local/test) 설정 추가
* chore: applicaion.yml에 sql.init.mode: never 추가

* chore: V1__create_tables.sql 추가
@chaiminwoo0223 chaiminwoo0223 self-assigned this Aug 29, 2025
Copy link
Contributor

@hisonghy hisonghy left a comment

Choose a reason for hiding this comment

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

고생하셨습니다!
Flyway를 사용해 모든 환경에서 스키마를 일관되게 유지하고, 마이그레이션/변경 사항을 버전 별로 관리해 이력을 추적할 수 있어 더욱 좋은 것 같아요

@chaiminwoo0223 chaiminwoo0223 merged commit 66c9390 into develop Aug 30, 2025
2 checks passed
@chaiminwoo0223 chaiminwoo0223 added the ⚙️chore 세팅 관련 label Sep 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⚙️chore 세팅 관련

Projects

None yet

Development

Successfully merging this pull request may close these issues.

⚙️[CHORE]: Flyway 설정을 통한 데이터베이스 스키마 관리 적용

2 participants