convert map definintion set to take only a json

This commit is contained in:
Paul Trowbridge 2018-05-24 17:01:03 -04:00
parent 6de5ece3d0
commit ad2a7ed68d
2 changed files with 9 additions and 7 deletions

View File

@ -1,4 +1,4 @@
CREATE OR REPLACE FUNCTION tps.srce_map_def_set(_srce text, _map text, _defn jsonb, _seq int) RETURNS jsonb
CREATE OR REPLACE FUNCTION tps.srce_map_def_set(_defn jsonb) RETURNS jsonb
AS
$f$
@ -15,15 +15,15 @@ BEGIN
INSERT INTO
tps.map_rm
SELECT
_srce
,_map
_defn->>'srce'
,_defn->>'name'
,_defn
,_seq
,_defn->>'sequence'
ON CONFLICT ON CONSTRAINT map_rm_pk DO UPDATE SET
srce = _srce
,target = _map
srce = _defn->>'srce'
,target = _defn->>'name'
,regex = _defn
,seq = _seq;
,seq = _defn->>'sequence';
EXCEPTION WHEN OTHERS THEN

View File

@ -1,4 +1,6 @@
{
"srce":"dcard",
"sequence":1,
"defn": [
{
"key": "{Description}",