some design, data model, data migration script
This commit is contained in:
14
scripts/datamigation/query_stats.sql
Normal file
14
scripts/datamigation/query_stats.sql
Normal file
@@ -0,0 +1,14 @@
|
||||
select
|
||||
CAST(extract(epoch from "createdAt") as integer) as "insertedAt"
|
||||
, "instanceId"
|
||||
, COALESCE((stats->>'numberOfUsers')::integer, -1) as users
|
||||
, COALESCE((stats->>'numberOfLocalGroups')::integer, -1) as local_groups
|
||||
, COALESCE((stats->>'numberOfGroups')::integer, -1) as total_groups
|
||||
, COALESCE((stats->>'numberOfLocalEvents')::integer, -1) as local_events
|
||||
, COALESCE((stats->>'numberOfEvents')::integer, -1) as total_events
|
||||
, COALESCE((stats->>'numberOfLocalComments')::integer, -1) as localcomments
|
||||
, COALESCE((stats->>'numberOfComments')::integer, -1) as total_comments
|
||||
, COALESCE((stats->>'numberOfInstanceFollowings')::integer, -1) as followings
|
||||
, COALESCE((stats->>'numberOfInstanceFollowers')::integer, -1) as followers
|
||||
from history
|
||||
order by "insertedAt", "instanceId"
|
Reference in New Issue
Block a user