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
!110
Teh call `get_profile` works
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Teh call `get_profile` works
mt-get-profile
into
develop
Overview
8
Commits
10
Pipelines
0
Changes
9
All threads resolved!
Hide all comments
Merged
Mariusz Trela
requested to merge
mt-get-profile
into
develop
4 years ago
Overview
8
Commits
10
Pipelines
0
Changes
1
All threads resolved!
Hide all comments
Expand
@bwrona
@ABW
0
0
Merge request reports
Compare
version 3
version 7
20d9f430
4 years ago
version 6
87f50620
4 years ago
version 5
5bd75a57
4 years ago
version 4
50be8ccc
4 years ago
version 3
07844132
4 years ago
version 2
d87b5743
4 years ago
version 1
d87b5743
4 years ago
develop (base)
and
version 4
latest version
f5a3bb82
10 commits,
4 years ago
version 7
20d9f430
9 commits,
4 years ago
version 6
87f50620
8 commits,
4 years ago
version 5
5bd75a57
7 commits,
4 years ago
version 4
50be8ccc
4 commits,
4 years ago
version 3
07844132
3 commits,
4 years ago
version 2
d87b5743
1 commit,
4 years ago
version 1
d87b5743
457 commits,
4 years ago
Show latest version
1 file
+
54
−
55
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
hive/db/schema.py
+
54
−
55
Options
@@ -567,62 +567,61 @@ def setup(db):
CREATE OR REPLACE VIEW public.hive_accounts_info_view
AS
SELECT id,
name,
display_name,
about,
reputation,
created_at,
profile_image,
location,
website,
cover_image,
rank,
following,
followers,
SELECT
id,
name,
display_name,
about,
reputation,
created_at,
profile_image,
location,
website,
cover_image,
rank,
following,
followers,
(
CASE
WHEN COALESCE( post_info.post_active_at,
'
1970-01-01 00:00:00.0
'
) > COALESCE( vote_info.vote_active_at,
'
1970-01-01 00:00:00.0
'
) THEN
(
CASE
WHEN post_info.post_active_at > vote_info.vote_active_at THEN
(
CASE
WHEN post_info.post_active_at > created_at THEN
post_info.post_active_at
ELSE
created_at
END
)
ELSE
(
CASE
WHEN vote_info.vote_active_at > created_at THEN
vote_info.vote_active_at
ELSE
created_at
END
)
END
) active_at,
proxy,
proxy_weight,
lastread_at,
cached_at,
raw_json,
post_info.post_count post_count
FROM hive_accounts ha
INNER JOIN
(
select COALESCE( count(*), 0 ) post_count, COALESCE( max(hp.created_at),
'
1970-01-01 00:00:00.0
'
) post_active_at, ha.id id_internal
from hive_posts hp
RIGHT JOIN hive_accounts ha ON hp.author_id = ha.id
GROUP BY ha.id
) post_info ON ha.id = post_info.id_internal
INNER JOIN
(
select COALESCE( max(hv.last_update),
'
1970-01-01 00:00:00.0
'
) vote_active_at, ha.id id_internal
from hive_votes hv
RIGHT JOIN hive_accounts ha ON hv.voter_id = ha.id
GROUP BY ha.id
) vote_info ON ha.id = vote_info.id_internal
CASE
WHEN COALESCE( post_info.post_active_at,
'
1970-01-01 00:00:00.0
'
) > created_at THEN
COALESCE( post_info.post_active_at,
'
1970-01-01 00:00:00.0
'
)
ELSE
created_at
END
)
ELSE
(
CASE
WHEN COALESCE( vote_info.vote_active_at,
'
1970-01-01 00:00:00.0
'
) > created_at THEN
COALESCE( vote_info.vote_active_at,
'
1970-01-01 00:00:00.0
'
)
ELSE
created_at
END
)
END
) active_at,
proxy,
proxy_weight,
lastread_at,
cached_at,
raw_json,
COALESCE( post_info.post_count, 0 ) post_count
from hive_accounts ha
LEFT JOIN
(
select count(*) post_count, max(created_at) post_active_at, author_id
from hive_posts
GROUP BY author_id
) post_info ON ha.id=post_info.author_id
LEFT JOIN
(
select max(last_update) vote_active_at, voter_id
from hive_votes
GROUP BY voter_id
)vote_info ON ha.id=vote_info.voter_id
"""
db
.
query_no_return
(
sql
)
Loading