Commit a6a4d9be authored by ludo's avatar ludo
Browse files

update migration/20.10/201017.sql

parent eeeff88b
......@@ -36,7 +36,7 @@ BEGIN
ELSE
SELECT entity_tree(parentid) INTO res;
RETURN res;
END IF;
END IF;
END;
$BODY$ LANGUAGE plpgsql;
......@@ -55,10 +55,10 @@ BEGIN
ELSE
SELECT ('"' || lastname || ' ' || firstname || '"')::JSONB INTO expe FROM users WHERE id = r.dest_user;
SELECT ('"' || entity_by_res_id(r.res_id) || '"')::JSONB INTO dest;
UPDATE res_letterbox SET custom_fields = jsonb_set(custom_fields,'{"20"}', expe) WHERE res_id = r.res_id RETURNing custom_fields INTO res;
UPDATE res_letterbox SET custom_fields = jsonb_set(custom_fields,'{"18"}', dest) WHERE res_id = r.res_id RETURNing custom_fields INTO res;
UPDATE res_letterbox SET custom_fields = jsonb_set(custom_fields,'{"20"}', expe) WHERE res_id = r.res_id RETURNING custom_fields INTO res;
UPDATE res_letterbox SET custom_fields = jsonb_set(custom_fields,'{"18"}', dest) WHERE res_id = r.res_id RETURNING custom_fields INTO res;
raise notice '%', res::TEXT;
END IF;
END IF;
END LOOP;
RETURN 'END';
END;
......@@ -66,4 +66,6 @@ $BODY$ LANGUAGE plpgsql;
SELECT migrate_expeditor_data();
DROP FUNCTION migrate_expeditor_data;
\ No newline at end of file
DROP FUNCTION migrate_expeditor_data;
UPDATE parameters SET param_value_string = '20.10.17' WHERE id = 'database_version';
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment