From 21ffef760f80b783c22e9f3781336600e6099ec7 Mon Sep 17 00:00:00 2001 From: XuJiacheng Date: Tue, 3 Mar 2026 20:21:55 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=88=86=E5=8C=BA?= =?UTF-8?q?=E8=A1=A8=E7=A9=BA=E9=97=B4=E9=85=8D=E7=BD=AE=EF=BC=8C=E7=A1=AE?= =?UTF-8?q?=E4=BF=9D=E5=88=9B=E5=BB=BA=E5=88=86=E5=8C=BA=E6=97=B6=E6=8C=87?= =?UTF-8?q?=E5=AE=9A=E8=A1=A8=E7=A9=BA=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bls-rcu-action-backend/src/db/partitionManager.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bls-rcu-action-backend/src/db/partitionManager.js b/bls-rcu-action-backend/src/db/partitionManager.js index 226f052..16e532c 100644 --- a/bls-rcu-action-backend/src/db/partitionManager.js +++ b/bls-rcu-action-backend/src/db/partitionManager.js @@ -2,6 +2,7 @@ import { logger } from '../utils/logger.js'; import dbManager from './databaseManager.js'; const PARENT_TABLE = 'rcu_action.rcu_action_events'; +const PARTITION_TABLESPACE = 'ts_hot'; const PARENT_INDEX_STATEMENTS = [ 'CREATE INDEX IF NOT EXISTS idx_rcu_action_hotel_id ON rcu_action.rcu_action_events (hotel_id);', 'CREATE INDEX IF NOT EXISTS idx_rcu_action_room_id ON rcu_action.rcu_action_events (room_id);', @@ -71,7 +72,8 @@ class PartitionManager { const createSql = ` CREATE TABLE IF NOT EXISTS ${partitionName} PARTITION OF ${PARENT_TABLE} - FOR VALUES FROM (${startMs}) TO (${endMs}); + FOR VALUES FROM (${startMs}) TO (${endMs}) + TABLESPACE ${PARTITION_TABLESPACE}; `; await client.query(createSql); }