diff --git a/core/Briefing-Common/build.gradle b/core/Briefing-Common/build.gradle index 68b8e7b..b2d1b44 100644 --- a/core/Briefing-Common/build.gradle +++ b/core/Briefing-Common/build.gradle @@ -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') { diff --git a/core/Briefing-Common/src/main/resources/application.yml b/core/Briefing-Common/src/main/resources/application.yml new file mode 100644 index 0000000..5fbd264 --- /dev/null +++ b/core/Briefing-Common/src/main/resources/application.yml @@ -0,0 +1,9 @@ +spring: + flyway: + enabled: true + baseline-on-migrate: true + baseline-version: 0 + + jpa: + hibernate: + ddl-auto: update \ No newline at end of file diff --git a/core/Briefing-Common/src/main/resources/db/migration/V1__change_NN_to_N1_relationship.sql b/core/Briefing-Common/src/main/resources/db/migration/V1__change_NN_to_N1_relationship.sql new file mode 100644 index 0000000..50b3200 --- /dev/null +++ b/core/Briefing-Common/src/main/resources/db/migration/V1__change_NN_to_N1_relationship.sql @@ -0,0 +1,3 @@ +UPDATE article a +JOIN briefing_article ba ON a.id = ba.article_id +SET a.briefing_id = ba.briefing_id; \ No newline at end of file