add fixture to tests

This commit is contained in:
2019-08-03 17:14:24 +02:00
parent 7c3028eca2
commit e31282e24e
16 changed files with 199 additions and 143 deletions

View File

@@ -1,5 +1,7 @@
do
$$
declare
article_count int = (select count(*) from article);
begin
delete from article_in_title;
delete from title;
@@ -29,7 +31,7 @@ begin
ti.id,
a.id,
ti.constitution_id
from (select *, (row_number() over () % 1005) rn from title, lateral generate_series(1, 3) g) ti
from (select *, (row_number() over () % (article_count+7)) rn from title, lateral generate_series(1, 3) g) ti
join (select *, row_number() over () rn from article) a using (rn);
raise notice 'constitution fixtures done';