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); }