#4 #20

Merged
flecomte merged 14 commits from #4 into master 2019-07-29 16:41:48 +02:00
Showing only changes of commit 6cd539d697 - Show all commits

View File

@@ -16,6 +16,15 @@ begin
from json_populate_record(null::article, resource) from json_populate_record(null::article, resource)
returning id into new_id; returning id into new_id;
if resource->>'relations' is not null then
insert into article_relations (source_id, target_id, created_by_id)
select
(resource->>'id')::uuid,
id,
(resource#>>'{created_by, id}')::uuid
from json_populate_recordset(null::article, resource->>'relations');
end if;
select find_article_by_id(new_id) into resource; select find_article_by_id(new_id) into resource;
end; end;
$$; $$;