实现酒店上下文单酒店收口

This commit is contained in:
andy
2026-07-10 15:31:51 +08:00
parent 7492c21350
commit d69f3975ef
52 changed files with 1183 additions and 188 deletions

View File

@@ -30,7 +30,6 @@ agentbus:
connect-timeout: 15s
capture:
enabled: true
default-hotel-id: HOTEL-DEV
superagent:
task-result:

View File

@@ -28,7 +28,6 @@ agentbus:
connect-timeout: 15s
capture:
enabled: true
default-hotel-id: ${AGENTBUS_PROD_DEFAULT_HOTEL_ID}
superagent:
task-result:

View File

@@ -30,7 +30,6 @@ agentbus:
connect-timeout: 15s
capture:
enabled: true
default-hotel-id: HOTEL-TEST
superagent:
task-result:

View File

@@ -24,7 +24,6 @@ agentbus:
max-frame-bytes: 1048576
capture:
enabled: ${AGENTBUS_CAPTURE_ENABLED:true}
default-hotel-id: HOTEL-TEST
superagent:
task-result:

View File

@@ -0,0 +1,10 @@
-- M005 酒店上下文统一:单酒店阶段数据库级约束平台酒店最多只能有一家 ACTIVE。
-- 上线前如已有多家 ACTIVE 酒店,应先人工确认保留哪一家,不能由迁移脚本静默禁用其他酒店。
ALTER TABLE platform_hotel
ADD COLUMN active_hotel_singleton_key VARCHAR(16) GENERATED ALWAYS AS (
CASE WHEN hotel_status = 'ACTIVE' THEN 'ACTIVE' ELSE NULL END
);
-- MySQL 唯一索引允许多个 NULL因此只会限制 platform_hotel 最多一条 hotel_status='ACTIVE'。
CREATE UNIQUE INDEX uk_platform_hotel_single_active
ON platform_hotel (active_hotel_singleton_key);