fix(health): align flyway baseline and ingress
This commit is contained in:
@@ -58,7 +58,7 @@ data:
|
||||
# ✅ 启用 Flyway - 使用新基线 V1.0.0(2026-01-03)
|
||||
SPRING_FLYWAY_ENABLED: "true"
|
||||
SPRING_FLYWAY_BASELINE_ON_MIGRATE: "true" # 已有数据库从 baseline 开始
|
||||
SPRING_FLYWAY_BASELINE_VERSION: "0"
|
||||
SPRING_FLYWAY_BASELINE_VERSION: "1.0.0"
|
||||
SPRING_FLYWAY_LOCATIONS: "classpath:db/migration"
|
||||
SPRING_FLYWAY_VALIDATE_ON_MIGRATE: "true"
|
||||
SPRING_FLYWAY_CLEAN_DISABLED: "true" # 生产环境禁用 clean
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
# =============================================================================
|
||||
# ljwx-health Ingress Configuration
|
||||
# 路由配置:
|
||||
# - health-admin.omniverseai.net -> ljwx-admin (Vue3 前端)
|
||||
# - health-dashboard.omniverseai.net -> ljwx-bigscreen (Flask 大屏)
|
||||
# - health-admin.omniverseai.net/api -> ljwx-boot (后端 API)
|
||||
# - health-admin.lingjingwanxiang.cn -> ljwx-admin (Vue3 前端)
|
||||
# - health-dashboard.lingjingwanxiang.cn -> ljwx-bigscreen (Flask 大屏)
|
||||
# - health-admin.lingjingwanxiang.cn/api -> ljwx-boot (后端 API)
|
||||
# - legacy omniverseai.net hosts remain during cutover
|
||||
# =============================================================================
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
@@ -26,12 +27,12 @@ metadata:
|
||||
nginx.ingress.kubernetes.io/proxy-send-timeout: "600"
|
||||
nginx.ingress.kubernetes.io/proxy-read-timeout: "600"
|
||||
spec:
|
||||
ingressClassName: nginx
|
||||
ingressClassName: traefik
|
||||
rules:
|
||||
# =========================================================================
|
||||
# Rule 1: health-admin.omniverseai.net
|
||||
# Rule 1: health-admin.lingjingwanxiang.cn
|
||||
# =========================================================================
|
||||
- host: health-admin.omniverseai.net
|
||||
- host: health-admin.lingjingwanxiang.cn
|
||||
http:
|
||||
paths:
|
||||
# 后端 API 路由
|
||||
@@ -52,9 +53,9 @@ spec:
|
||||
number: 80
|
||||
|
||||
# =========================================================================
|
||||
# Rule 2: health-dashboard.omniverseai.net
|
||||
# Rule 2: health-dashboard.lingjingwanxiang.cn
|
||||
# =========================================================================
|
||||
- host: health-dashboard.omniverseai.net
|
||||
- host: health-dashboard.lingjingwanxiang.cn
|
||||
http:
|
||||
paths:
|
||||
# 大屏应用
|
||||
@@ -65,3 +66,30 @@ spec:
|
||||
name: ljwx-bigscreen
|
||||
port:
|
||||
number: 5001
|
||||
- host: health-admin.omniverseai.net
|
||||
http:
|
||||
paths:
|
||||
- path: /api
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: ljwx-boot
|
||||
port:
|
||||
number: 9998
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: ljwx-admin
|
||||
port:
|
||||
number: 80
|
||||
- host: health-dashboard.omniverseai.net
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: ljwx-bigscreen
|
||||
port:
|
||||
number: 5001
|
||||
|
||||
@@ -32,26 +32,11 @@ spec:
|
||||
- sh
|
||||
- -c
|
||||
- |
|
||||
set -eu
|
||||
echo "检查并修复 Flyway schema history..."
|
||||
|
||||
# 删除所有失败的迁移记录
|
||||
mysql -h mysql-lb.infra.svc.cluster.local -u root -p${MYSQL_ROOT_PASSWORD} ljwx_health <<EOF
|
||||
|
||||
-- 检查 flyway_schema_history 表是否存在
|
||||
SELECT CASE WHEN COUNT(*) > 0 THEN 'Flyway history table exists'
|
||||
ELSE 'No flyway history table found' END AS status
|
||||
FROM information_schema.tables
|
||||
WHERE table_schema = 'ljwx_health'
|
||||
AND table_name = 'flyway_schema_history';
|
||||
|
||||
-- 显示所有迁移记录
|
||||
SELECT CONCAT('Total migrations before cleanup: ', COUNT(*)) AS count FROM flyway_schema_history;
|
||||
|
||||
-- 完全删除 flyway_schema_history 表,让 Flyway 重新开始
|
||||
DROP TABLE IF EXISTS flyway_schema_history;
|
||||
|
||||
SELECT 'Flyway schema history table dropped. Flyway will recreate it on next run.' AS result;
|
||||
|
||||
EOF
|
||||
|
||||
echo "✅ Flyway schema history 修复完成"
|
||||
|
||||
Reference in New Issue
Block a user