update postgresjson

This commit is contained in:
2019-08-27 12:33:32 +02:00
parent 67665350eb
commit ff76bd55ef
29 changed files with 139 additions and 119 deletions

View File

@@ -50,7 +50,7 @@ begin
select "comment"(
reference => 'article'::regclass,
target_id => (created_article->>'id')::uuid,
citizen_id => _citizen_id,
created_by_id => _citizen_id,
content => 'Ho my god !'::text
) into _comment_id;
assert (select count(*) = 1 from "comment"), 'comment must be inserted';
@@ -86,7 +86,7 @@ begin
select "comment"(
reference => 'article'::regclass,
target_id => (created_article->>'id')::uuid,
citizen_id => _citizen_id,
created_by_id => _citizen_id,
content => 'God not exist'::text,
parent_id => _comment_id::uuid
) into _comment_id_response;
@@ -94,7 +94,7 @@ begin
select "comment"(
reference => 'article'::regclass,
target_id => (created_article->>'id')::uuid,
citizen_id => _citizen_id,
created_by_id => _citizen_id,
content => 'are you really sure ?'::text,
parent_id => _comment_id_response::uuid
) into _comment_id_response2;

View File

@@ -41,7 +41,7 @@ begin
perform vote(
reference => 'article'::regclass,
_target_id => (created_article->>'id')::uuid,
_citizen_id => _citizen_id,
_created_by_id => _citizen_id,
_note => 1
);
assert (select count(*) = 1 from vote_for_article), 'vote must be inserted';
@@ -50,7 +50,7 @@ begin
perform vote(
reference => 'article'::regclass,
_target_id => (created_article->>'id')::uuid,
_citizen_id => _citizen_id,
_created_by_id => _citizen_id,
_note => -1
);
assert (select count(*) = 1 from vote_for_article), 'vote must be inserted';
@@ -60,7 +60,7 @@ begin
perform vote(
reference => 'article'::regclass,
_target_id => (created_article->>'id')::uuid,
_citizen_id => _citizen_id,
_created_by_id => _citizen_id,
_note => -10
);
assert false, 'vote must be throw exception if note is not -1, 0 or 1';