update postgresjson
This commit is contained in:
@@ -5,7 +5,7 @@ declare
|
||||
begin
|
||||
delete from follow;
|
||||
|
||||
insert into follow_article (id, citizen_id, target_id)
|
||||
insert into follow_article (id, created_by_id, target_id)
|
||||
select
|
||||
uuid_in(md5('follow_article'||row_number() over ())::cstring),
|
||||
z.id,
|
||||
@@ -13,7 +13,7 @@ begin
|
||||
from (select *, row_number() over () % (article_count+7) rn from citizen, lateral generate_series(1, 5)) z
|
||||
join (select *, row_number() over () rn from article) a using (rn);
|
||||
|
||||
insert into follow_constitution (id, citizen_id, target_id)
|
||||
insert into follow_constitution (id, created_by_id, target_id)
|
||||
select
|
||||
uuid_in(md5('follow_constitution'||row_number() over ())::cstring),
|
||||
z.id,
|
||||
@@ -21,7 +21,7 @@ begin
|
||||
from (select *, row_number() over () % (article_count+7) rn from citizen, lateral generate_series(1, 5)) z
|
||||
join (select *, row_number() over () rn from constitution) a using (rn);
|
||||
|
||||
insert into follow_citizen (id, citizen_id, target_id)
|
||||
insert into follow_citizen (id, created_by_id, target_id)
|
||||
select
|
||||
uuid_in(md5('follow_citizen'||row_number() over ())::cstring),
|
||||
z.id,
|
||||
|
||||
@@ -5,7 +5,7 @@ declare
|
||||
begin
|
||||
delete from comment;
|
||||
|
||||
insert into comment_on_article (id, citizen_id, target_id, content)
|
||||
insert into comment_on_article (id, created_by_id, target_id, content)
|
||||
select
|
||||
uuid_in(md5('comment_on_article'||row_number() over ())::cstring),
|
||||
z.id,
|
||||
@@ -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, citizen_id, target_id, content, parent_id)
|
||||
insert into comment_on_article (id, created_by_id, target_id, content, parent_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, citizen_id, target_id, content, parent_id)
|
||||
insert into comment_on_article (id, created_by_id, target_id, content, parent_id)
|
||||
select
|
||||
uuid_in(md5('comment_on_article_3'||row_number() over ())::cstring),
|
||||
z.id,
|
||||
@@ -34,7 +34,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 where parent_id is not null) a using (rn);
|
||||
|
||||
insert into comment_on_constitution (id, citizen_id, target_id, content)
|
||||
insert into comment_on_constitution (id, created_by_id, target_id, content)
|
||||
select
|
||||
uuid_in(md5('comment_on_constitution'||row_number() over ())::cstring),
|
||||
z.id,
|
||||
|
||||
@@ -8,7 +8,7 @@ begin
|
||||
delete from vote_for_comment_on_article;
|
||||
delete from vote_for_comment_on_constitution;
|
||||
raise notice '%', article_count;
|
||||
insert into vote_for_article (id, citizen_id, target_id, note, anonymous)
|
||||
insert into vote_for_article (id, created_by_id, target_id, note, anonymous)
|
||||
select
|
||||
uuid_in(md5('vote_for_article'||row_number() over ())::cstring),
|
||||
z.id,
|
||||
@@ -18,7 +18,7 @@ raise notice '%', article_count;
|
||||
from (select *, row_number() over ()+g % (article_count+7) rn, g from citizen, lateral generate_series(1, 5) g) z
|
||||
join (select *, row_number() over () rn from article) a using (rn);
|
||||
|
||||
insert into vote_for_constitution (id, citizen_id, target_id, note, anonymous)
|
||||
insert into vote_for_constitution (id, created_by_id, target_id, note, anonymous)
|
||||
select
|
||||
uuid_in(md5('vote_for_constitution'||row_number() over ())::cstring),
|
||||
z.id,
|
||||
@@ -28,7 +28,7 @@ raise notice '%', article_count;
|
||||
from (select *, row_number() over () % (article_count+7) rn, g from citizen, lateral generate_series(1, 5) g) z
|
||||
join (select *, row_number() over () rn from constitution) a using (rn);
|
||||
|
||||
insert into vote_for_comment_on_article (id, citizen_id, target_id, note, anonymous)
|
||||
insert into vote_for_comment_on_article (id, created_by_id, target_id, note, anonymous)
|
||||
select
|
||||
uuid_in(md5('vote_for_comment_on_article'||row_number() over ())::cstring),
|
||||
z.id,
|
||||
@@ -38,7 +38,7 @@ raise notice '%', article_count;
|
||||
from (select *, row_number() over () % (article_count+7) rn, g from citizen, lateral generate_series(1, 3) g) z
|
||||
join (select *, row_number() over () rn from comment_on_article) a using (rn);
|
||||
|
||||
insert into vote_for_comment_on_constitution (id, citizen_id, target_id, note, anonymous)
|
||||
insert into vote_for_comment_on_constitution (id, created_by_id, target_id, note, anonymous)
|
||||
select
|
||||
uuid_in(md5('vote_for_comment_on_constitution'||row_number() over ())::cstring),
|
||||
z.id,
|
||||
|
||||
Reference in New Issue
Block a user