From 5bb29f739a8d5fd76278fe4d772bf4fe4926000c Mon Sep 17 00:00:00 2001 From: siyeonSon Date: Tue, 9 Apr 2024 21:55:00 +0900 Subject: [PATCH 1/4] :recycle: refactor(domain): manage flyway scripts in api -> domain --- .../src/main/resources/db/migration/V1__init.sql | 0 .../db/migration/V20230822__add_search_term_recommend.sql | 0 .../main/resources/db/migration/V20230911__add_banned_word.sql | 0 .../resources/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 .../db/migration/V20240207__add_content_column_to_item_claim.sql | 0 .../main/resources/db/migration/V20240305__add_popup_table.sql | 0 .../resources/db/migration/V20240404__add_notification_table.sql | 0 9 files changed, 0 insertions(+), 0 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/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 From 65cd694533aeff963228bd8e90146782d3bd49f2 Mon Sep 17 00:00:00 2001 From: siyeonSon Date: Wed, 10 Apr 2024 00:31:24 +0900 Subject: [PATCH 2/4] :wrench: config(domain): move database settings to domain module --- backend/streetdrop-api/build.gradle | 4 ---- backend/streetdrop-batch/build.gradle | 4 ---- backend/streetdrop-domain/build.gradle | 4 ++++ 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/backend/streetdrop-api/build.gradle b/backend/streetdrop-api/build.gradle index 56d4b81c..4084f0e9 100644 --- a/backend/streetdrop-api/build.gradle +++ b/backend/streetdrop-api/build.gradle @@ -17,7 +17,6 @@ dependencies { implementation project(':streetdrop-domain') implementation project(':streetdrop-common') implementation 'org.springframework.boot:spring-boot-starter-data-jpa' - runtimeOnly 'com.mysql:mysql-connector-j' implementation 'org.hibernate:hibernate-spatial:6.2.2.Final' implementation 'org.locationtech.jts:jts-core' implementation 'org.springframework.boot:spring-boot-starter-security' @@ -39,9 +38,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..52e90419 100644 --- a/backend/streetdrop-batch/build.gradle +++ b/backend/streetdrop-batch/build.gradle @@ -21,10 +21,6 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-jpa' 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' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1' diff --git a/backend/streetdrop-domain/build.gradle b/backend/streetdrop-domain/build.gradle index d4ec6e90..52af69e0 100644 --- a/backend/streetdrop-domain/build.gradle +++ b/backend/streetdrop-domain/build.gradle @@ -17,4 +17,8 @@ dependencies { annotationProcessor "com.querydsl:querydsl-apt:5.0.0:jakarta" annotationProcessor "jakarta.annotation:jakarta.annotation-api" annotationProcessor "jakarta.persistence:jakarta.persistence-api" + + runtimeOnly 'com.mysql:mysql-connector-j' + implementation 'org.flywaydb:flyway-core' + implementation 'org.flywaydb:flyway-mysql' } \ No newline at end of file From 63ccf7a182aa69a829c3c64af4bfb393ad388848 Mon Sep 17 00:00:00 2001 From: siyeonSon Date: Wed, 10 Apr 2024 00:42:09 +0900 Subject: [PATCH 3/4] :wrench: config: change the path of flyway scripts --- .github/workflows/flyway-naming-check.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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 From da2983c21bdc166049cebccd945124121d58e35c Mon Sep 17 00:00:00 2001 From: siyeonSon Date: Thu, 11 Apr 2024 15:05:26 +0900 Subject: [PATCH 4/4] :recycle: refactor(api, batch): add mysql dependency --- backend/streetdrop-api/build.gradle | 1 + backend/streetdrop-batch/build.gradle | 2 ++ backend/streetdrop-domain/build.gradle | 1 - 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/streetdrop-api/build.gradle b/backend/streetdrop-api/build.gradle index 4084f0e9..2f4b4a8b 100644 --- a/backend/streetdrop-api/build.gradle +++ b/backend/streetdrop-api/build.gradle @@ -17,6 +17,7 @@ dependencies { implementation project(':streetdrop-domain') implementation project(':streetdrop-common') implementation 'org.springframework.boot:spring-boot-starter-data-jpa' + runtimeOnly 'com.mysql:mysql-connector-j' implementation 'org.hibernate:hibernate-spatial:6.2.2.Final' implementation 'org.locationtech.jts:jts-core' implementation 'org.springframework.boot:spring-boot-starter-security' diff --git a/backend/streetdrop-batch/build.gradle b/backend/streetdrop-batch/build.gradle index 52e90419..0005c42a 100644 --- a/backend/streetdrop-batch/build.gradle +++ b/backend/streetdrop-batch/build.gradle @@ -21,6 +21,8 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter-security' + runtimeOnly 'com.mysql:mysql-connector-j' + implementation 'com.google.firebase:firebase-admin:9.1.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1' diff --git a/backend/streetdrop-domain/build.gradle b/backend/streetdrop-domain/build.gradle index 52af69e0..1eaa80fd 100644 --- a/backend/streetdrop-domain/build.gradle +++ b/backend/streetdrop-domain/build.gradle @@ -18,7 +18,6 @@ dependencies { annotationProcessor "jakarta.annotation:jakarta.annotation-api" annotationProcessor "jakarta.persistence:jakarta.persistence-api" - runtimeOnly 'com.mysql:mysql-connector-j' implementation 'org.flywaydb:flyway-core' implementation 'org.flywaydb:flyway-mysql' } \ No newline at end of file