feature #19: improve comment fixtures and add sub comments
This commit is contained in:
@@ -7,16 +7,34 @@ begin
|
|||||||
select
|
select
|
||||||
z.id,
|
z.id,
|
||||||
a.id,
|
a.id,
|
||||||
'content' || row_number() over () * g
|
'content' || (row_number() over () * g)
|
||||||
from (select *, row_number() over () % 995 rn, g from citizen, lateral generate_series(1, 5) g) z
|
from (select *, row_number() over () % 995 rn from citizen, lateral generate_series(1, 5) g) z
|
||||||
join (select *, row_number() over () rn from article) a using (rn);
|
join (select *, row_number() over () rn from article) a using (rn);
|
||||||
|
|
||||||
|
insert into comment_on_article (citizen_id, target_id, content, parent_id)
|
||||||
|
select
|
||||||
|
z.id,
|
||||||
|
a.target_id,
|
||||||
|
'content' || row_number() over () * g,
|
||||||
|
a.id
|
||||||
|
from (select *, row_number() over () % 995 rn from citizen, lateral generate_series(1, 5) g) z
|
||||||
|
join (select *, row_number() over () rn from comment_on_article) a using (rn);
|
||||||
|
|
||||||
|
insert into comment_on_article (citizen_id, target_id, content, parent_id)
|
||||||
|
select
|
||||||
|
z.id,
|
||||||
|
a.target_id,
|
||||||
|
'content' || row_number() over () * g,
|
||||||
|
a.id
|
||||||
|
from (select *, row_number() over () % 995 rn from citizen, lateral generate_series(1, 5) g) z
|
||||||
|
join (select *, row_number() over () rn from comment_on_article where parent_id is not null) a using (rn);
|
||||||
|
|
||||||
insert into comment_on_constitution (citizen_id, target_id, content)
|
insert into comment_on_constitution (citizen_id, target_id, content)
|
||||||
select
|
select
|
||||||
z.id,
|
z.id,
|
||||||
a.id,
|
a.id,
|
||||||
'content' || row_number() over () * g
|
'content' || row_number() over () * g
|
||||||
from (select *, row_number() over () % 995 rn, g from citizen, lateral generate_series(1, 5) g) z
|
from (select *, row_number() over () % 995 rn from citizen, lateral generate_series(1, 5) g) z
|
||||||
join (select *, row_number() over () rn from constitution) a using (rn);
|
join (select *, row_number() over () rn from constitution) a using (rn);
|
||||||
|
|
||||||
raise notice 'comment fixtures done';
|
raise notice 'comment fixtures done';
|
||||||
|
|||||||
Reference in New Issue
Block a user