Skip to content
Snippets Groups Projects
Commit a0c08b48 authored by Martin Lees's avatar Martin Lees
Browse files

test

parent 41288813
No related branches found
No related tags found
No related merge requests found
...@@ -86,7 +86,7 @@ ON CONFLICT DO NOTHING ...@@ -86,7 +86,7 @@ ON CONFLICT DO NOTHING
; ;
if _parent_author != '' THEN if _parent_author != '' THEN
RETURN QUERY INSERT INTO hive_posts as hp RETURN QUERY INSERT INTO hive_posts as hp
(parent_id, depth, _community_id, category_id, (parent_id, depth, community_id, category_id,
root_id, is_muted, is_valid, root_id, is_muted, is_valid,
author_id, permlink_id, created_at, updated_at, sc_hot, sc_trend, active, payout_at, cashout_time, counter_deleted, block_num, block_num_created) author_id, permlink_id, created_at, updated_at, sc_hot, sc_trend, active, payout_at, cashout_time, counter_deleted, block_num, block_num_created)
SELECT php.id AS parent_id, php.depth + 1 AS depth, SELECT php.id AS parent_id, php.depth + 1 AS depth,
...@@ -94,14 +94,14 @@ if _parent_author != '' THEN ...@@ -94,14 +94,14 @@ if _parent_author != '' THEN
WHEN _block_num > _community_support_start_block THEN WHEN _block_num > _community_support_start_block THEN
COALESCE(php.community_id, (select hc.id from hive_communities hc where hc.name = _parent_permlink)) COALESCE(php.community_id, (select hc.id from hive_communities hc where hc.name = _parent_permlink))
ELSE NULL ELSE NULL
END) AS _community_id, -- community id has to be decorated because it creates confusion between the column and the variable END) AS community_id,
COALESCE(php.category_id, (select hcg.id from hive_category_data hcg where hcg.category = _parent_permlink)) AS category_id, COALESCE(php.category_id, (select hcg.id from hive_category_data hcg where hcg.category = _parent_permlink)) AS category_id,
(CASE(php.root_id) (CASE(php.root_id)
WHEN 0 THEN php.id WHEN 0 THEN php.id
ELSE php.root_id ELSE php.root_id
END) AS root_id, END) AS root_id,
(CASE (CASE
WHEN _community_id is not null and php.is_muted = false THEN WHEN hp.community_id is not null and php.is_muted = false THEN
is_user_allowed_to_post_to_community(community_id, author_id, true) is_user_allowed_to_post_to_community(community_id, author_id, true)
ELSE php.is_muted ELSE php.is_muted
END) AS is_muted, END) AS is_muted,
...@@ -137,7 +137,7 @@ ELSE ...@@ -137,7 +137,7 @@ ELSE
; ;
RETURN QUERY INSERT INTO hive_posts as hp RETURN QUERY INSERT INTO hive_posts as hp
(parent_id, depth, _community_id, category_id, (parent_id, depth, community_id, category_id,
root_id, is_muted, is_valid, root_id, is_muted, is_valid,
author_id, permlink_id, created_at, updated_at, sc_hot, sc_trend, author_id, permlink_id, created_at, updated_at, sc_hot, sc_trend,
active, payout_at, cashout_time, counter_deleted, block_num, block_num_created, active, payout_at, cashout_time, counter_deleted, block_num, block_num_created,
...@@ -147,12 +147,12 @@ ELSE ...@@ -147,12 +147,12 @@ ELSE
WHEN _block_num > _community_support_start_block THEN WHEN _block_num > _community_support_start_block THEN
(select hc.id FROM hive_communities hc WHERE hc.name = _parent_permlink) (select hc.id FROM hive_communities hc WHERE hc.name = _parent_permlink)
ELSE NULL ELSE NULL
END) AS _community_id, -- community id has to be decorated because it creates confusion between the column and the variable END) AS community_id,
(SELECT hcg.id FROM hive_category_data hcg WHERE hcg.category = _parent_permlink) AS category_id, (SELECT hcg.id FROM hive_category_data hcg WHERE hcg.category = _parent_permlink) AS category_id,
0 as root_id, -- will use id as root one if no parent 0 as root_id, -- will use id as root one if no parent
(CASE (CASE
WHEN _community_id is not null THEN WHEN hp.community_id is not null THEN
is_user_allowed_to_post_to_community(_community_id, author_id, false) is_user_allowed_to_post_to_community(hp.community_id, author_id, false)
ELSE false ELSE false
END) AS is_muted, true AS is_valid, END) AS is_muted, true AS is_valid,
ha.id AS author_id, hpd.id AS permlink_id, _date AS created_at, ha.id AS author_id, hpd.id AS permlink_id, _date AS created_at,
......
  • Howo @howo

    mentioned in commit adaf0414

    ·

    mentioned in commit adaf0414

    Toggle commit list
  • Howo @howo

    mentioned in commit 20480803

    ·

    mentioned in commit 20480803

    Toggle commit list
  • Howo @howo

    mentioned in commit cd01716c

    ·

    mentioned in commit cd01716c

    Toggle commit list
  • Howo @howo

    mentioned in commit e88b39ff

    ·

    mentioned in commit e88b39ff

    Toggle commit list
  • Howo @howo

    mentioned in commit a3bd6741

    ·

    mentioned in commit a3bd6741

    Toggle commit list
  • Howo @howo

    mentioned in commit 13e985d4

    ·

    mentioned in commit 13e985d4

    Toggle commit list
  • Howo @howo

    mentioned in commit f9f460d7

    ·

    mentioned in commit f9f460d7

    Toggle commit list
  • Howo @howo

    mentioned in commit 80a3a3a1

    ·

    mentioned in commit 80a3a3a1

    Toggle commit list
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment