From 0fc44c2ba97b6841a6b169c5089e7890d60157c3 Mon Sep 17 00:00:00 2001 From: siyeonSon <87802191+siyeonSon@users.noreply.github.com> Date: Thu, 11 Apr 2024 15:09:13 +0900 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor(domain):=20manage?= =?UTF-8?q?=20flyway=20scripts=20in=20api=20->=20domain=20(#462)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * :recycle: refactor(domain): manage flyway scripts in api -> domain * :wrench: config(domain): move database settings to domain module * :wrench: config: change the path of flyway scripts * :recycle: refactor(api, batch): add mysql dependency --- .github/workflows/flyway-naming-check.yml | 4 +--- backend/streetdrop-api/build.gradle | 3 --- backend/streetdrop-batch/build.gradle | 2 -- backend/streetdrop-domain/build.gradle | 3 +++ .../src/main/resources/db/migration/V1__init.sql | 0 .../db/migration/V20230822__add_search_term_recommend.sql | 0 .../resources/db/migration/V20230911__add_banned_word.sql | 0 .../db/migration/V20231103__add_index_to_item_like.sql | 0 .../V20231112__add_active_column_to_search_recommend_term.sql | 0 .../db/migration/V20240206__add_distance_to_users_level.sql | 0 .../migration/V20240207__add_content_column_to_item_claim.sql | 0 .../resources/db/migration/V20240305__add_popup_table.sql | 0 .../db/migration/V20240404__add_notification_table.sql | 0 13 files changed, 4 insertions(+), 8 deletions(-) rename backend/{streetdrop-api => streetdrop-domain}/src/main/resources/db/migration/V1__init.sql (100%) rename backend/{streetdrop-api => streetdrop-domain}/src/main/resources/db/migration/V20230822__add_search_term_recommend.sql (100%) rename backend/{streetdrop-api => streetdrop-domain}/src/main/resources/db/migration/V20230911__add_banned_word.sql (100%) rename backend/{streetdrop-api => streetdrop-domain}/src/main/resources/db/migration/V20231103__add_index_to_item_like.sql (100%) rename backend/{streetdrop-api => streetdrop-domain}/src/main/resources/db/migration/V20231112__add_active_column_to_search_recommend_term.sql (100%) rename backend/{streetdrop-api => streetdrop-domain}/src/main/resources/db/migration/V20240206__add_distance_to_users_level.sql (100%) rename backend/{streetdrop-api => streetdrop-domain}/src/main/resources/db/migration/V20240207__add_content_column_to_item_claim.sql (100%) rename backend/{streetdrop-api => streetdrop-domain}/src/main/resources/db/migration/V20240305__add_popup_table.sql (100%) rename backend/{streetdrop-api => streetdrop-domain}/src/main/resources/db/migration/V20240404__add_notification_table.sql (100%) diff --git a/.github/workflows/flyway-naming-check.yml b/.github/workflows/flyway-naming-check.yml index 836bb1b8..39826997 100644 --- a/.github/workflows/flyway-naming-check.yml +++ b/.github/workflows/flyway-naming-check.yml @@ -4,13 +4,11 @@ on: push: branches: [ "*" ] paths: - - "backend/streetdrop-api/**" - "backend/streetdrop-domain/**" - "backend/streetdrop-common/**" pull_request: branches: [ "main", "dev" ] paths: - - "backend/streetdrop-api/**" - "backend/streetdrop-domain/**" - "backend/streetdrop-common/**" - ".github/workflows/flyway-naming-check.yml" @@ -23,4 +21,4 @@ jobs: - name: flyway-naming-checker uses: seonghun-dev/flyway-naming-checker@v0.1.0 with: - path: 'backend/streetdrop-api/src/main/resources/db/migration' \ No newline at end of file + path: 'backend/streetdrop-domain/src/main/resources/db/migration' \ No newline at end of file diff --git a/backend/streetdrop-api/build.gradle b/backend/streetdrop-api/build.gradle index 56d4b81c..2f4b4a8b 100644 --- a/backend/streetdrop-api/build.gradle +++ b/backend/streetdrop-api/build.gradle @@ -39,9 +39,6 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-webflux' implementation 'io.awspring.cloud:spring-cloud-starter-aws:2.4.4' - - implementation 'org.flywaydb:flyway-core' - implementation 'org.flywaydb:flyway-mysql' } diff --git a/backend/streetdrop-batch/build.gradle b/backend/streetdrop-batch/build.gradle index a4bb8fa9..0005c42a 100644 --- a/backend/streetdrop-batch/build.gradle +++ b/backend/streetdrop-batch/build.gradle @@ -22,8 +22,6 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-security' runtimeOnly 'com.mysql:mysql-connector-j' - implementation 'org.flywaydb:flyway-core' - implementation 'org.flywaydb:flyway-mysql' implementation 'com.google.firebase:firebase-admin:9.1.0' diff --git a/backend/streetdrop-domain/build.gradle b/backend/streetdrop-domain/build.gradle index d4ec6e90..1eaa80fd 100644 --- a/backend/streetdrop-domain/build.gradle +++ b/backend/streetdrop-domain/build.gradle @@ -17,4 +17,7 @@ dependencies { annotationProcessor "com.querydsl:querydsl-apt:5.0.0:jakarta" annotationProcessor "jakarta.annotation:jakarta.annotation-api" annotationProcessor "jakarta.persistence:jakarta.persistence-api" + + implementation 'org.flywaydb:flyway-core' + implementation 'org.flywaydb:flyway-mysql' } \ No newline at end of file diff --git a/backend/streetdrop-api/src/main/resources/db/migration/V1__init.sql b/backend/streetdrop-domain/src/main/resources/db/migration/V1__init.sql similarity index 100% rename from backend/streetdrop-api/src/main/resources/db/migration/V1__init.sql rename to backend/streetdrop-domain/src/main/resources/db/migration/V1__init.sql diff --git a/backend/streetdrop-api/src/main/resources/db/migration/V20230822__add_search_term_recommend.sql b/backend/streetdrop-domain/src/main/resources/db/migration/V20230822__add_search_term_recommend.sql similarity index 100% rename from backend/streetdrop-api/src/main/resources/db/migration/V20230822__add_search_term_recommend.sql rename to backend/streetdrop-domain/src/main/resources/db/migration/V20230822__add_search_term_recommend.sql diff --git a/backend/streetdrop-api/src/main/resources/db/migration/V20230911__add_banned_word.sql b/backend/streetdrop-domain/src/main/resources/db/migration/V20230911__add_banned_word.sql similarity index 100% rename from backend/streetdrop-api/src/main/resources/db/migration/V20230911__add_banned_word.sql rename to backend/streetdrop-domain/src/main/resources/db/migration/V20230911__add_banned_word.sql diff --git a/backend/streetdrop-api/src/main/resources/db/migration/V20231103__add_index_to_item_like.sql b/backend/streetdrop-domain/src/main/resources/db/migration/V20231103__add_index_to_item_like.sql similarity index 100% rename from backend/streetdrop-api/src/main/resources/db/migration/V20231103__add_index_to_item_like.sql rename to backend/streetdrop-domain/src/main/resources/db/migration/V20231103__add_index_to_item_like.sql diff --git a/backend/streetdrop-api/src/main/resources/db/migration/V20231112__add_active_column_to_search_recommend_term.sql b/backend/streetdrop-domain/src/main/resources/db/migration/V20231112__add_active_column_to_search_recommend_term.sql similarity index 100% rename from backend/streetdrop-api/src/main/resources/db/migration/V20231112__add_active_column_to_search_recommend_term.sql rename to backend/streetdrop-domain/src/main/resources/db/migration/V20231112__add_active_column_to_search_recommend_term.sql diff --git a/backend/streetdrop-api/src/main/resources/db/migration/V20240206__add_distance_to_users_level.sql b/backend/streetdrop-domain/src/main/resources/db/migration/V20240206__add_distance_to_users_level.sql similarity index 100% rename from backend/streetdrop-api/src/main/resources/db/migration/V20240206__add_distance_to_users_level.sql rename to backend/streetdrop-domain/src/main/resources/db/migration/V20240206__add_distance_to_users_level.sql diff --git a/backend/streetdrop-api/src/main/resources/db/migration/V20240207__add_content_column_to_item_claim.sql b/backend/streetdrop-domain/src/main/resources/db/migration/V20240207__add_content_column_to_item_claim.sql similarity index 100% rename from backend/streetdrop-api/src/main/resources/db/migration/V20240207__add_content_column_to_item_claim.sql rename to backend/streetdrop-domain/src/main/resources/db/migration/V20240207__add_content_column_to_item_claim.sql diff --git a/backend/streetdrop-api/src/main/resources/db/migration/V20240305__add_popup_table.sql b/backend/streetdrop-domain/src/main/resources/db/migration/V20240305__add_popup_table.sql similarity index 100% rename from backend/streetdrop-api/src/main/resources/db/migration/V20240305__add_popup_table.sql rename to backend/streetdrop-domain/src/main/resources/db/migration/V20240305__add_popup_table.sql diff --git a/backend/streetdrop-api/src/main/resources/db/migration/V20240404__add_notification_table.sql b/backend/streetdrop-domain/src/main/resources/db/migration/V20240404__add_notification_table.sql similarity index 100% rename from backend/streetdrop-api/src/main/resources/db/migration/V20240404__add_notification_table.sql rename to backend/streetdrop-domain/src/main/resources/db/migration/V20240404__add_notification_table.sql