Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hivemind
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
hivemind
Commits
fc52ea6c
Commit
fc52ea6c
authored
4 years ago
by
Bartek Wrona
Browse files
Options
Downloads
Patches
Plain Diff
Fixed bugs in bridge_get_account_posts_by_blog implementation to match original function behavior.
parent
09f66e6e
No related branches found
No related tags found
2 merge requests
!456
Release candidate v1 24
,
!358
get account posts by blog fixes
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hive/db/sql_scripts/bridge_get_account_posts_by_blog.sql
+14
-25
14 additions, 25 deletions
hive/db/sql_scripts/bridge_get_account_posts_by_blog.sql
with
14 additions
and
25 deletions
hive/db/sql_scripts/bridge_get_account_posts_by_blog.sql
+
14
−
25
View file @
fc52ea6c
...
...
@@ -17,16 +17,12 @@ BEGIN
IF
_permlink
<>
''
THEN
__post_id
=
find_comment_id
(
_author
,
_permlink
,
True
);
__created_at
=
(
SELECT
created_at
FROM
hive_feed_cache
WHERE
account_id
=
__account_id
AND
post_id
=
__post_id
);
SELECT
hfc
.
created_at
INTO
__created_at
FROM
hive_feed_cache
hfc
WHERE
hfc
.
account_id
=
__account_id
AND
hfc
.
post_id
=
__post_id
;
END
IF
;
RETURN
QUERY
SELECT
RETURN
QUERY
SELECT
-- bridge_get_account_posts_by_blog
hp
.
id
,
hp
.
author
,
hp
.
parent_author
,
...
...
@@ -66,25 +62,18 @@ BEGIN
FROM
hive_posts_view
hp
JOIN
(
SELECT
hfc
.
post_id
SELECT
hfc
.
post_id
,
hfc
.
created_at
FROM
hive_feed_cache
hfc
LEFT
JOIN
(
SELECT
hp
.
id
FROM
hive_posts_view
hp
LEFT
JOIN
hive_reblogs
hr
ON
hp
.
id
=
hr
.
post_id
WHERE
hp
.
author_id
=
__account_id
AND
hp
.
depth
=
0
AND
hp
.
community_id
IS
NOT
NULL
)
T
ON
hfc
.
post_id
=
T
.
id
WHERE
hfc
.
account_id
=
__account_id
AND
(
__post_id
=
0
OR
hfc
.
created_at
<=
__created_at
)
ORDER
BY
hfc
.
created_at
DESC
WHERE
hfc
.
account_id
=
__account_id
AND
(
__post_id
=
0
OR
hfc
.
created_at
<=
__created_at
)
AND
NOT
EXISTS
(
SELECT
NULL
FROM
hive_posts
hp
WHERE
hp
.
id
=
hfc
.
post_id
AND
hp
.
counter_deleted
=
0
AND
hp
.
depth
=
0
AND
hp
.
community_id
IS
NOT
NULL
AND
NOT
EXISTS
(
SELECT
NULL
FROM
hive_reblogs
hr
WHERE
hr
.
blogger_id
=
__account_id
)
)
ORDER
BY
created_at
DESC
LIMIT
_limit
)
T
ON
hp
.
id
=
T
.
post_id
LIMIT
_limit
;
ORDER
BY
T
.
created_at
DESC
;
END
$
function
$
language
plpgsql
STABLE
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment