Implement comment constitution
fix bugs
This commit is contained in:
@@ -1,17 +1,13 @@
|
||||
create or replace function edit_comment(reference regclass, _id uuid, _content text) returns void
|
||||
create or replace function edit_comment(_id uuid, _content text) returns void
|
||||
language plpgsql as
|
||||
$$
|
||||
begin
|
||||
if reference = 'article'::regclass then
|
||||
update comment_on_article c set
|
||||
update comment c set
|
||||
"content" = _content
|
||||
where c.id = _id;
|
||||
elseif reference = 'constitution'::regclass then
|
||||
update comment_on_constitution c set
|
||||
"content" = _content
|
||||
where c.id = _id;
|
||||
end if;
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists edit_comment(regclass, uuid, text);
|
||||
-- drop function if exists edit_comment(regclass, uuid, text);
|
||||
|
||||
-- select edit_comment('b0422e48-687f-bea7-b45f-b6b301246e97', 'plop4')
|
||||
Reference in New Issue
Block a user