From 1b5d66e85e7df0ba4207327e32c75704a576398f Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 17 Feb 2024 08:34:47 -0700 Subject: [PATCH] Refresh each subscription publication --- resources/classes/schema.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/resources/classes/schema.php b/resources/classes/schema.php index a13279ca64..f5e1e2c9b4 100644 --- a/resources/classes/schema.php +++ b/resources/classes/schema.php @@ -894,6 +894,21 @@ if (!class_exists('schema')) { unset ($sql_update, $sql); } + //refresh each postgresql subscription with its publication + if ($db_type == "pgsql") { + //get the list of postgresql subscriptions + $sql = "select subname from pg_subscription; "; + $pg_subscriptions = $this->database->select($sql, null, 'all'); + unset($sql, $parameters); + + //refresh each subscription publication + foreach ($pg_subscriptions as $row) { + $sql = "ALTER SUBSCRIPTION ".$row['subname']." REFRESH PUBLICATION;"; + $response .= $sql; + $this->database->execute($sql); + } + } + //handle response //if ($output == "echo") { // echo $response; @@ -914,4 +929,3 @@ if (!class_exists('schema')) { //print_r($result_array); ?> -