Skip to content

Commit

Permalink
✨ Feature: DB 마이그레이션을 위한 flyway 도입 (#201)
Browse files Browse the repository at this point in the history
* ➕ Chore: Flyway 의존성 추가

* 🔧 Chore: application.yml flyway 설정

git status

* ✨ Feat: DB 마이그레이션 스크립트 작성

* 🗃️ Feat: 스크립트 수정
  • Loading branch information
ahnsugyeong authored Apr 14, 2024
1 parent f7a2466 commit beeb6eb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/Briefing-Common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-redis:2.3.1.RELEASE'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'

// Flyway
implementation 'org.flywaydb:flyway-core'
implementation 'org.flywaydb:flyway-mysql'
}

tasks.named('test') {
Expand Down
9 changes: 9 additions & 0 deletions core/Briefing-Common/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
spring:
flyway:
enabled: true
baseline-on-migrate: true
baseline-version: 0

jpa:
hibernate:
ddl-auto: update
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
UPDATE article a
JOIN briefing_article ba ON a.id = ba.article_id
SET a.briefing_id = ba.briefing_id;

0 comments on commit beeb6eb

Please sign in to comment.