change parent_id in comment

This commit is contained in:
2019-09-22 01:16:42 +02:00
parent a37afc1ada
commit dc490dcac3
5 changed files with 28 additions and 22 deletions

View File

@@ -14,7 +14,7 @@ begin
from (select *, row_number() over () % (article_count+7) rn from citizen, lateral generate_series(1, 5) g) z
join (select *, row_number() over () rn from article) a using (rn);
insert into comment_on_article (id, created_by_id, target_id, content, parent_id)
insert into comment_on_article (id, created_by_id, target_id, content, parent_comment_id)
select
uuid_in(md5('comment_on_article_2'||row_number() over ())::cstring),
z.id,
@@ -24,7 +24,7 @@ begin
from (select *, row_number() over () % (article_count+7) 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 (id, created_by_id, target_id, content, parent_id)
insert into comment_on_article (id, created_by_id, target_id, content, parent_comment_id)
select
uuid_in(md5('comment_on_article_3'||row_number() over ())::cstring),
z.id,
@@ -32,7 +32,7 @@ begin
'content' || row_number() over () * g,
a.id
from (select *, row_number() over () % (article_count+7) 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);
join (select *, row_number() over () rn from comment_on_article where parent_comment_id is not null) a using (rn);
insert into comment_on_constitution (id, created_by_id, target_id, content)
select