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
Merge requests
!410
more small changes, get_discussions_by_blog reusing bridge SQL function
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
more small changes, get_discussions_by_blog reusing bridge SQL function
abw_code_cleanup2
into
develop
Overview
0
Commits
8
Pipelines
0
Changes
14
Merged
Andrzej Lisak
requested to merge
abw_code_cleanup2
into
develop
4 years ago
Overview
0
Commits
8
Pipelines
0
Changes
14
Expand
0
0
Merge request reports
Compare
develop
version 1
422a8888
4 years ago
develop (base)
and
latest version
latest version
cdcefa75
8 commits,
4 years ago
version 1
422a8888
7 commits,
4 years ago
14 files
+
299
−
168
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
14
Search (e.g. *.vue) (Ctrl+P)
hive/db/sql_scripts/bridge_get_account_posts_by_blog.sql
+
17
−
14
Options
@@ -4,19 +4,20 @@ CREATE OR REPLACE FUNCTION bridge_get_account_posts_by_blog(
in
_account
VARCHAR
,
in
_author
VARCHAR
,
in
_permlink
VARCHAR
,
in
_limit
INTEGER
in
_limit
INTEGER
,
in
_bridge_api
BOOLEAN
)
RETURNS
SETOF
bridge_api_post
AS
$
function
$
DECLARE
__post_id
INTEGER
:
=
0
;
__account_id
INTEGER
:
=
find_account_id
(
_account
,
True
)
;
__post_id
INTEGER
;
__account_id
INTEGER
;
__created_at
TIMESTAMP
;
BEGIN
IF
_permlink
<>
''
THEN
__post_id
=
find_comment_id
(
_author
,
_permlink
,
True
);
__account_id
=
find_account_id
(
_account
,
True
);
__post_id
=
find_comment_id
(
_author
,
_permlink
,
True
);
IF
__post_id
<>
0
THEN
SELECT
hfc
.
created_at
INTO
__created_at
FROM
hive_feed_cache
hfc
WHERE
hfc
.
account_id
=
__account_id
AND
hfc
.
post_id
=
__post_id
;
@@ -65,16 +66,18 @@ BEGIN
(
SELECT
hfc
.
post_id
,
hfc
.
created_at
FROM
hive_feed_cache
hfc
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
AND
hr
.
post_id
=
hp
.
id
)
WHERE
hfc
.
account_id
=
__account_id
AND
(
__post_id
=
0
OR
hfc
.
created_at
<
__created_at
OR
(
hfc
.
created_at
=
__created_at
AND
hfc
.
post_id
<
__post_id
)
)
AND
(
NOT
_bridge_api
OR
NOT
EXISTS
(
SELECT
NULL
FROM
hive_posts
hp1
WHERE
hp1
.
id
=
hfc
.
post_id
AND
hp1
.
counter_deleted
=
0
AND
hp1
.
depth
=
0
AND
hp1
.
community_id
IS
NOT
NULL
AND
NOT
EXISTS
(
SELECT
NULL
FROM
hive_reblogs
hr
WHERE
hr
.
blogger_id
=
__account_id
AND
hr
.
post_id
=
hp1
.
id
)
)
)
ORDER
BY
created_at
DESC
,
post_id
DESC
ORDER
BY
hfc
.
created_at
DESC
,
hfc
.
post_id
DESC
LIMIT
_limit
)
T
ON
hp
.
id
=
T
.
post_id
ORDER
BY
T
.
created_at
DESC
,
T
.
post_id
DESC
;
)
blog
ON
hp
.
id
=
blog
.
post_id
ORDER
BY
blog
.
created_at
DESC
,
blog
.
post_id
DESC
LIMIT
_limit
;
END
$
function
$
language
plpgsql
STABLE
;
Loading