Add script to launch SQL test
This commit is contained in:
@@ -7,7 +7,7 @@ begin
|
||||
delete from vote_for_constitution;
|
||||
delete from vote_for_comment_on_article;
|
||||
delete from vote_for_comment_on_constitution;
|
||||
raise notice '%', article_count;
|
||||
|
||||
insert into vote_for_article (id, created_by_id, target_id, note, anonymous)
|
||||
select
|
||||
uuid_in(md5('vote_for_article'||row_number() over ())::cstring),
|
||||
|
||||
@@ -25,8 +25,6 @@ begin
|
||||
join (select *, row_number() over () rn from article) a using (rn);
|
||||
end loop;
|
||||
|
||||
raise notice '% opinion inserted', (select count(*) from opinion_on_article);
|
||||
|
||||
raise notice 'opinions fixtures done';
|
||||
end;
|
||||
$$;
|
||||
|
||||
@@ -18,4 +18,4 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists find_article_by_id(uuid, out json);
|
||||
|
||||
|
||||
@@ -60,6 +60,3 @@ begin
|
||||
) as t;
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists find_articles(text, json, text, text, int, int);
|
||||
-- select find_article_by_id('d91aa0cd-61d6-83cc-41bb-8d5656e130f7');
|
||||
@@ -15,4 +15,4 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists find_articles_versions_by_id(uuid, int, int, out json);
|
||||
|
||||
|
||||
@@ -25,4 +25,4 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists find_articles_versions_by_version_id(uuid, int, int, out json);
|
||||
|
||||
|
||||
@@ -21,4 +21,3 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists find_last_article_by_version_id(uuid, inout json);
|
||||
@@ -64,4 +64,3 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop procedure if exists upsert_article(inout json);
|
||||
@@ -12,4 +12,3 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists find_citizen_by_email(text, out json);
|
||||
@@ -14,4 +14,3 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists find_citizen_by_id(uuid, inout json);
|
||||
@@ -14,4 +14,3 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists find_citizen_by_id_with_user(uuid, inout json);
|
||||
@@ -14,4 +14,3 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists find_citizen_by_user_id(uuid, inout json);
|
||||
@@ -15,4 +15,3 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists find_citizen_by_username(text, out json);
|
||||
@@ -41,4 +41,4 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists find_citizens(text, text, text, int, int);
|
||||
|
||||
|
||||
@@ -30,4 +30,3 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists create_citizen_with_user(inout json);
|
||||
@@ -27,4 +27,3 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists upsert_citizen(inout json);
|
||||
@@ -21,4 +21,3 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists comment(regclass, uuid, uuid, text, uuid);
|
||||
@@ -7,7 +7,3 @@ begin
|
||||
where c.id = _id;
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists edit_comment(uuid, text);
|
||||
|
||||
-- select edit_comment('b0422e48-687f-bea7-b45f-b6b301246e97', 'plop4')
|
||||
@@ -18,4 +18,4 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists find_comment_by_id(uuid, out json);
|
||||
|
||||
|
||||
@@ -37,5 +37,3 @@ begin
|
||||
) as t;
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists find_comments_by_citizen(uuid, regclass, int, int);
|
||||
|
||||
@@ -24,5 +24,3 @@ begin
|
||||
) as t;
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists find_comments_by_parent(uuid, int, int);
|
||||
|
||||
@@ -34,4 +34,4 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists find_comments_by_target(uuid, int, int);
|
||||
|
||||
|
||||
@@ -29,4 +29,3 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists create_title_in_constitution(out json);
|
||||
@@ -16,4 +16,3 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists find_constitution_by_id(uuid, out json);
|
||||
@@ -21,4 +21,3 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists find_constitution_title_by_id(uuid, out json);
|
||||
@@ -16,5 +16,3 @@ begin
|
||||
) as t;
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists find_constitution_titles_by_id(uuid, out json);
|
||||
@@ -39,5 +39,3 @@ begin
|
||||
) as t;
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists find_constitutions(text, text, text, int, int);
|
||||
|
||||
@@ -52,5 +52,3 @@ begin
|
||||
select find_constitution_by_id(new_id) into resource;
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists upsert_constitution(inout json);
|
||||
@@ -21,5 +21,3 @@ begin
|
||||
select resource is not null into following;
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists find_follow(uuid, uuid);
|
||||
|
||||
@@ -22,5 +22,3 @@ begin
|
||||
) as t;
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists find_follows_article_by_citizen(uuid, int, int);
|
||||
|
||||
@@ -30,8 +30,3 @@ begin
|
||||
) as t;
|
||||
end
|
||||
$$;
|
||||
|
||||
-- drop function if exists find_follows_article_by_target(uuid, int, int);
|
||||
-- select * from find_follows_article_by_target('32518c76-5c58-3cd1-00cd-7f9d0bb872cd', 20, 0);
|
||||
-- select * from find_follows_article_by_target('24a373f4-c321-4006-8d05-3c50f95a561b', 100, 0);
|
||||
-- SELECT * FROM find_follows_article_by_target ("_target_id" := '24a373f4-c321-4006-8d05-3c50f95a561b'::uuid, "offset" := 0::int, "limit" := 300::int)
|
||||
@@ -23,4 +23,3 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists find_follows_by_citizen(uuid, int, int);
|
||||
|
||||
@@ -23,4 +23,4 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists find_follows_constitution_by_citizen(uuid, int, int);
|
||||
|
||||
|
||||
@@ -20,4 +20,3 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists follow(regclass, uuid, uuid);
|
||||
@@ -37,4 +37,3 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists unfollow(regclass, uuid, uuid);
|
||||
@@ -23,7 +23,3 @@ begin
|
||||
resource = resource::jsonb || jsonb_build_object('reference', _reference);
|
||||
end
|
||||
$$;
|
||||
|
||||
-- drop function if exists find_reference_by_id(uuid, regclass, out json);
|
||||
|
||||
-- select find_reference_by_id('8944221c-3766-f952-7064-9f229c288049'::uuid, 'constitution'::regclass)
|
||||
@@ -21,7 +21,3 @@ begin
|
||||
resource = coalesce(agg, empty);
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists count_opinion(uuid);
|
||||
|
||||
-- select * from count_opinion('d91aa0cd-61d6-83cc-41bb-8d5656e130f7');
|
||||
@@ -44,5 +44,3 @@ begin
|
||||
) t;
|
||||
end
|
||||
$$;
|
||||
|
||||
-- select * from find_citizen_opinions('6434f4f9-f570-f22a-c134-8668350651ff', null, null, 2, 2);
|
||||
|
||||
@@ -27,4 +27,4 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists find_citizen_votes_by_target_ids(uuid, uuid[], regclass);
|
||||
|
||||
|
||||
@@ -24,7 +24,3 @@ begin
|
||||
) t;
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists find_citizen_votes_by_target_ids(uuid, uuid[], regclass);
|
||||
|
||||
-- select * from find_citizen_opinions_by_target_ids('045b6e9e-5a9e-d9b0-75d4-e51f0bc6cd21', '{32a18b25-507d-49d8-5168-7675fb6a7b8c, 429bfd8c-ebc2-09ac-227f-28bcdaa91d84, 550f4543-35a3-9910-e493-70d26b931473}')
|
||||
@@ -19,4 +19,4 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists find_opinion_by_id(uuid, out json);
|
||||
|
||||
|
||||
@@ -24,4 +24,4 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists find_opinion_by_opinion(json);
|
||||
|
||||
|
||||
@@ -9,7 +9,3 @@ begin
|
||||
and (ol.id = _id);
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists find_opinion_choice_by_id();
|
||||
|
||||
-- select find_opinion_choice_by_id('8c6cb3cc-cac5-93ad-312e-6bd87d9916d9');
|
||||
@@ -18,7 +18,3 @@ begin
|
||||
) t;
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists find_opinions();
|
||||
|
||||
-- select find_opinion_choices('{}');
|
||||
|
||||
@@ -20,4 +20,3 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists upsert_opinion(json);
|
||||
@@ -17,4 +17,3 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists upsert_opinion_choice(json);
|
||||
@@ -9,4 +9,3 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists change_user_password(json);
|
||||
@@ -15,4 +15,3 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists check_user(text, text, out json);
|
||||
@@ -9,4 +9,3 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists find_user_by_id(uuid, out json);
|
||||
@@ -9,4 +9,3 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists find_user_by_username(text, out json);
|
||||
@@ -17,4 +17,3 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists insert_user(inout json);
|
||||
@@ -36,7 +36,3 @@ begin
|
||||
jsonb_build_object('percent', percent);
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists count_vote(uuid);
|
||||
|
||||
-- select * from count_vote('ced1563f-ecf5-4f11-8518-8aeceff3c13a');
|
||||
@@ -29,4 +29,4 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists find_citizen_votes_by_target_ids(uuid, uuid[], regclass);
|
||||
|
||||
|
||||
@@ -37,4 +37,4 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists find_votes_by_citizen(uuid, regclass, int, int);
|
||||
|
||||
|
||||
@@ -38,4 +38,3 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists vote(regclass,uuid,uuid,integer,boolean);
|
||||
@@ -14,4 +14,4 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop procedure if exists update_workgroup_members(in uuid, inout json);
|
||||
|
||||
|
||||
@@ -18,5 +18,5 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists find_workgroup_by_id(uuid, out json);
|
||||
|
||||
-- select * from find_workgroup_by_id('d011ad4c-fa1b-40a3-593b-7816479ff33b')
|
||||
|
||||
@@ -13,4 +13,4 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists find_workgroup_members(uuid, out json);
|
||||
|
||||
|
||||
@@ -54,6 +54,3 @@ begin
|
||||
) as t;
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop function if exists find_workgroups(text, json, text, text, int, int);
|
||||
-- select * from find_workgroups('49', "limit" := 2)
|
||||
@@ -14,4 +14,3 @@ begin
|
||||
end
|
||||
$$;
|
||||
|
||||
-- drop procedure if exists remove_workgroup_members(in uuid, inout json);
|
||||
@@ -23,4 +23,3 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop procedure if exists update_workgroup_members(in uuid, inout json);
|
||||
@@ -31,4 +31,3 @@ begin
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop procedure if exists upsert_workgroup(inout json);
|
||||
Reference in New Issue
Block a user