From ffdb7c56fea17495fbe84f38f5153e3b090891ec Mon Sep 17 00:00:00 2001 From: XuqmGroup Date: Sat, 13 Jun 2026 00:05:31 +0800 Subject: [PATCH] =?UTF-8?q?fix(flyway):=20=E5=90=84=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E7=8B=AC=E7=AB=8B=E5=8E=86=E5=8F=B2=E8=A1=A8?= =?UTF-8?q?=E5=90=8D=EF=BC=8C=E8=A7=A3=E5=86=B3=E5=85=B1=E4=BA=AB=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 私有化部署所有服务共用同一 MySQL 库,Flyway 默认都写 flyway_schema_history,导致不同服务的 V1 checksum 互相 覆盖/冲突。改为每个服务使用独立的表名: flyway_history_{tenant|im|file|update|license|push|demo} Co-Authored-By: Claude Sonnet 4.6 --- demo-service/src/main/resources/application.yml | 1 + file-service/src/main/resources/application.yml | 1 + im-service/src/main/resources/application.yml | 1 + license-service/src/main/resources/application.yml | 1 + push-service/src/main/resources/application.yml | 1 + tenant-service/src/main/resources/application.yml | 1 + update-service/src/main/resources/application.yml | 1 + 7 files changed, 7 insertions(+) diff --git a/demo-service/src/main/resources/application.yml b/demo-service/src/main/resources/application.yml index d06d3d2..60322c1 100644 --- a/demo-service/src/main/resources/application.yml +++ b/demo-service/src/main/resources/application.yml @@ -34,6 +34,7 @@ spring: baseline-on-migrate: true baseline-version: 0 locations: classpath:db/migration + table: flyway_history_demo jwt: secret: ${XUQM_JWT_SECRET:xuqm-tenant-service-secret-key-must-be-at-least-256-bits-long-for-hmac} diff --git a/file-service/src/main/resources/application.yml b/file-service/src/main/resources/application.yml index a42ffa4..4b24039 100644 --- a/file-service/src/main/resources/application.yml +++ b/file-service/src/main/resources/application.yml @@ -39,6 +39,7 @@ spring: baseline-on-migrate: true baseline-version: 0 locations: classpath:db/migration + table: flyway_history_file jwt: secret: ${XUQM_JWT_SECRET:xuqm-tenant-service-secret-key-must-be-at-least-256-bits-long-for-hmac} diff --git a/im-service/src/main/resources/application.yml b/im-service/src/main/resources/application.yml index 8ad9056..b142050 100644 --- a/im-service/src/main/resources/application.yml +++ b/im-service/src/main/resources/application.yml @@ -43,6 +43,7 @@ spring: baseline-on-migrate: true baseline-version: 0 locations: classpath:db/migration + table: flyway_history_im jwt: secret: ${XUQM_JWT_SECRET:xuqm-tenant-service-secret-key-must-be-at-least-256-bits-long-for-hmac} diff --git a/license-service/src/main/resources/application.yml b/license-service/src/main/resources/application.yml index 92e6f92..5d26933 100644 --- a/license-service/src/main/resources/application.yml +++ b/license-service/src/main/resources/application.yml @@ -31,6 +31,7 @@ spring: baseline-on-migrate: true baseline-version: 0 locations: classpath:db/migration + table: flyway_history_license jwt: secret: ${XUQM_JWT_SECRET:xuqm-tenant-service-secret-key-must-be-at-least-256-bits-long-for-hmac} diff --git a/push-service/src/main/resources/application.yml b/push-service/src/main/resources/application.yml index c9f741d..2902fb4 100644 --- a/push-service/src/main/resources/application.yml +++ b/push-service/src/main/resources/application.yml @@ -24,6 +24,7 @@ spring: baseline-on-migrate: true baseline-version: 0 locations: classpath:db/migration + table: flyway_history_push jwt: secret: ${XUQM_JWT_SECRET:xuqm-tenant-service-secret-key-must-be-at-least-256-bits-long-for-hmac} diff --git a/tenant-service/src/main/resources/application.yml b/tenant-service/src/main/resources/application.yml index cad9c3c..5d1cbb5 100644 --- a/tenant-service/src/main/resources/application.yml +++ b/tenant-service/src/main/resources/application.yml @@ -57,6 +57,7 @@ spring: baseline-on-migrate: true baseline-version: 0 locations: classpath:db/migration + table: flyway_history_tenant jwt: secret: ${XUQM_JWT_SECRET:xuqm-tenant-service-secret-key-must-be-at-least-256-bits-long-for-hmac} diff --git a/update-service/src/main/resources/application.yml b/update-service/src/main/resources/application.yml index b228d16..69dc77c 100644 --- a/update-service/src/main/resources/application.yml +++ b/update-service/src/main/resources/application.yml @@ -28,6 +28,7 @@ spring: baseline-on-migrate: true baseline-version: 0 locations: classpath:db/migration + table: flyway_history_update jwt: secret: ${XUQM_JWT_SECRET:xuqm-tenant-service-secret-key-must-be-at-least-256-bits-long-for-hmac}