From 271a55d6e31a03f1f4645fc28e973c7a09b7551a Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Tue, 12 Jun 2018 22:21:16 -0400 Subject: [PATCH] include flag to rebuild; may not want to if due to layout change --- interface/map_def/srce_map_def_set_single.sql | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/interface/map_def/srce_map_def_set_single.sql b/interface/map_def/srce_map_def_set_single.sql index e16709e..c22c488 100644 --- a/interface/map_def/srce_map_def_set_single.sql +++ b/interface/map_def/srce_map_def_set_single.sql @@ -1,4 +1,4 @@ -CREATE OR REPLACE FUNCTION tps.srce_map_def_set_single(_defn jsonb) RETURNS jsonb +CREATE OR REPLACE FUNCTION tps.srce_map_def_set_single(_defn jsonb, _rebuild BOOLEAN) RETURNS jsonb AS $f$ @@ -63,12 +63,14 @@ BEGIN --------------if rebuild was flag call the rebuild-------------------------------------------------------------------------------- - SELECT - x.message||'{"step":"overwrite maps in tps.trans"}'::jsonb - INTO - _message - FROM - tps.srce_map_overwrite(_defn->>'srce') as X(message); + IF _rebuild THEN + SELECT + x.message||'{"step":"overwrite maps in tps.trans"}'::jsonb + INTO + _message + FROM + tps.srce_map_overwrite(_defn->>'srce') as X(message); + END IF; return _message;