Skip to content

chore: Flyway 마이그레이션 검증 환경 구축 (#149) - #153

Merged
young0206 merged 3 commits into
mainfrom
chore/149-flyway
Aug 9, 2026
Merged

chore: Flyway 마이그레이션 검증 환경 구축 (#149)#153
young0206 merged 3 commits into
mainfrom
chore/149-flyway

Conversation

@young0206

@young0206 young0206 commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

🔗 관련 이슈 (Related Issue)

Closes #149

📝 작업 내용

  • Flyway Gradle Plugin 추가
  • Flyway 전용 DB 접속 환경변수(FLYWAY_URL, FLYWAY_USER, FLYWAY_PASSWORD) 설정
  • Flyway migration 명령 및 안전장치 추가
    • flywayInfo
    • flywayMigrate
    • flywayValidate
    • flywayRepair
    • flywayClean 실행 차단
  • CI에 MySQL 8.4.9 기반 migration 검증 환경 추가
  • V8 baseline 스키마를 기준으로 V009 이후 migration 적용 및 검증
  • migration 적용 후 Hibernate ddl-auto=validate를 통한 JPA 엔티티/DB 스키마 일치 검증 추가
  • 기존 테스트, 빌드 및 Docker 이미지 빌드 과정 유지

✅ PR 체크리스트

  • PR 제목은 커밋 컨벤션을 따랐습니다.
  • 관련 이슈를 연결했습니다.
  • 변경 사항에 대한 테스트를 진행했습니다.

Summary by CodeRabbit

  • 테스트

    • CI 환경에서 MySQL 데이터베이스 마이그레이션의 적용 및 검증 절차를 추가했습니다.
    • 마이그레이션된 스키마와 애플리케이션 엔티티의 일치 여부를 자동으로 확인합니다.
  • 개선

    • 데이터베이스 스키마 기준 버전을 추가하고, 마이그레이션 검증 및 기준화 설정을 정비했습니다.
    • 필수 데이터베이스 연결 정보가 누락되면 빌드가 명확히 실패하도록 개선했습니다.

@young0206 young0206 self-assigned this Aug 8, 2026
@young0206 young0206 added the deploy 배포 및 인프라 관련 작업 label Aug 8, 2026
@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a14ce39d-f637-45c4-adee-269b09fb24b8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Flyway Gradle 플러그인과 MySQL 8.4.9 CI 서비스를 추가했다. V8 기준 스키마를 로드한 뒤 Flyway 마이그레이션 검증과 JPA 스키마 검증 테스트를 실행한다.

Changes

Flyway CI 스키마 검증

Layer / File(s) Summary
Flyway Gradle 설정
.github/workflows/ci.yml, build.gradle
Flyway 플러그인과 MySQL 의존성을 추가했다. 환경 변수 기반 연결 설정과 Flyway 데이터베이스 작업을 구성했다.
V8 기준 스키마
.github/flyway/baseline-v8.sql
CI용 MySQL V8 기준 스키마를 추가했다. 도메인 테이블, 인덱스, 유니크 제약조건, 외래 키, 생성 컬럼을 정의하고 세션 설정을 복원한다.
CI 마이그레이션 및 JPA 검증
.github/workflows/ci.yml, src/test/resources/application-flyway-ci.yml, src/test/java/com/slatto/global/database/FlywaySchemaValidationTest.java
CI에서 기준 스키마를 로드하고 Flyway의 baseline, info, migrate, validate 작업을 실행한다. flyway-ci 프로파일에서 JPA 스키마 검증 테스트를 실행한다.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GitHubActions
  participant MySQL
  participant Flyway
  participant JpaSchemaValidationTest
  GitHubActions->>MySQL: V8 기준 스키마 로드
  GitHubActions->>Flyway: baseline, info, migrate, validate 실행
  Flyway->>MySQL: 마이그레이션 및 스키마 검증
  GitHubActions->>JpaSchemaValidationTest: flyway-ci 테스트 실행
  JpaSchemaValidationTest->>MySQL: JPA ddl-auto validate 수행
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed 제목이 Flyway 관련 변경을 명확히 나타내며 변경 범위와 직접 관련됩니다.
Description check ✅ Passed 관련 이슈, 작업 내용, PR 체크리스트를 모두 포함하고 변경 사항과 테스트 내용을 구체적으로 설명합니다.
Linked Issues check ✅ Passed [149] Flyway 플러그인, 명령어, 임시 MySQL 기반 CI 검증, V8 baseline 유지 요구사항을 충족합니다.
Out of Scope Changes check ✅ Passed 변경 사항이 Flyway 설정, CI migration 검증, baseline 스키마, JPA 스키마 검증 범위에 포함됩니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/flyway/baseline-v8.sql:
- Around line 193-208: Update the project_file schema so file_size matches
ProjectFile.fileSize by either removing the non-nullable entity constraint or
adding a migration that makes file_size NOT NULL with an appropriate default; do
not leave the database column nullable while the entity requires a value.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 23756db9-c226-4631-8c76-e032fb9e07b6

📥 Commits

Reviewing files that changed from the base of the PR and between 02ab2e4 and 7edcf70.

📒 Files selected for processing (5)
  • .github/flyway/baseline-v8.sql
  • .github/workflows/ci.yml
  • build.gradle
  • src/test/java/com/slatto/global/database/FlywaySchemaValidationTest.java
  • src/test/resources/application-flyway-ci.yml

Comment thread .github/flyway/baseline-v8.sql
@young0206
young0206 merged commit c1a02b6 into main Aug 9, 2026
2 checks passed
@young0206
young0206 deleted the chore/149-flyway branch August 9, 2026 12:24
@chazy-d chazy-d changed the title Chore/149 flyway chore: Flyway 마이그레이션 검증 환경 구축 (#149) Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deploy 배포 및 인프라 관련 작업

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CHORE: Flyway Gradle Plugin 및 CI 검증 추가

2 participants