Skip to content
GitLab
Explore
Sign in
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
6b0913b6
Commit
6b0913b6
authored
4 years ago
by
Mariusz Trela
Browse files
Options
Downloads
Patches
Plain Diff
Added a view `hive_accounts_info_view` into `upgrade.sql` file
parent
a044e104
No related branches found
Branches containing commit
No related tags found
1 merge request
!145
A 'get_profile' implementation
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/upgrade.sql
+53
-0
53 additions, 0 deletions
scripts/upgrade.sql
with
53 additions
and
0 deletions
scripts/upgrade.sql
+
53
−
0
View file @
6b0913b6
...
@@ -90,3 +90,56 @@ $function$
...
@@ -90,3 +90,56 @@ $function$
JOIN
hive_posts_view
hp
ON
hp
.
id
=
trends
.
id
ORDER
BY
trends
.
trend
DESC
JOIN
hive_posts_view
hp
ON
hp
.
id
=
trends
.
id
ORDER
BY
trends
.
trend
DESC
$
function
$
$
function
$
language
sql
language
sql
DROP
VIEW
IF
EXISTS
public
.
hive_accounts_info_view
;
CREATE
OR
REPLACE
VIEW
public
.
hive_accounts_info_view
AS
SELECT
id
,
name
,
(
select
count
(
*
)
post_count
FROM
hive_posts
hp
WHERE
ha
.
id
=
hp
.
author_id
)
post_count
,
created_at
,
(
SELECT
GREATEST
(
created_at
,
COALESCE
(
(
select
max
(
hp
.
created_at
)
FROM
hive_posts
hp
WHERE
ha
.
id
=
hp
.
author_id
),
'1970-01-01 00:00:00.0'
),
COALESCE
(
(
select
max
(
hv
.
last_update
)
from
hive_votes
hv
WHERE
ha
.
id
=
hv
.
voter_id
),
'1970-01-01 00:00:00.0'
)
)
)
active_at
,
display_name
,
about
,
reputation
,
profile_image
,
location
,
website
,
cover_image
,
rank
,
following
,
followers
,
proxy
,
proxy_weight
,
lastread_at
,
cached_at
,
raw_json
FROM
hive_accounts
ha
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