feat: sync monoforum and collectible emoji status
Sync telesrv bd15657 (feat(account): implement collectible emoji status). Skipped telesrv docs changes per public sync rules.
This commit is contained in:
parent
edb7057757
commit
0c99ae0a9d
91 changed files with 4061 additions and 693 deletions
|
|
@ -22,6 +22,8 @@ SELECT
|
|||
u.premium_expires_at,
|
||||
u.emoji_status_document_id,
|
||||
u.emoji_status_until,
|
||||
u.emoji_status_collectible_id,
|
||||
u.emoji_status_collectible,
|
||||
u.last_seen_at
|
||||
FROM contacts c
|
||||
JOIN users u ON u.id = c.contact_user_id
|
||||
|
|
@ -52,6 +54,8 @@ SELECT
|
|||
u.premium_expires_at,
|
||||
u.emoji_status_document_id,
|
||||
u.emoji_status_until,
|
||||
u.emoji_status_collectible_id,
|
||||
u.emoji_status_collectible,
|
||||
u.last_seen_at
|
||||
FROM contacts c
|
||||
JOIN users u ON u.id = c.contact_user_id
|
||||
|
|
@ -130,6 +134,8 @@ SELECT
|
|||
u.premium_expires_at,
|
||||
u.emoji_status_document_id,
|
||||
u.emoji_status_until,
|
||||
u.emoji_status_collectible_id,
|
||||
u.emoji_status_collectible,
|
||||
u.last_seen_at,
|
||||
EXISTS (SELECT 1 FROM reverse_updated)::boolean AS reverse_mutual_changed
|
||||
FROM upserted c
|
||||
|
|
@ -168,6 +174,8 @@ SELECT
|
|||
u.premium_expires_at,
|
||||
u.emoji_status_document_id,
|
||||
u.emoji_status_until,
|
||||
u.emoji_status_collectible_id,
|
||||
u.emoji_status_collectible,
|
||||
u.last_seen_at
|
||||
FROM updated c
|
||||
JOIN users u ON u.id = c.contact_user_id;
|
||||
|
|
|
|||
|
|
@ -37,6 +37,8 @@ WITH matched AS (
|
|||
u.premium_expires_at,
|
||||
u.emoji_status_document_id,
|
||||
u.emoji_status_until,
|
||||
u.emoji_status_collectible_id,
|
||||
u.emoji_status_collectible,
|
||||
u.color_set,
|
||||
u.color,
|
||||
u.color_background_emoji_id,
|
||||
|
|
@ -86,6 +88,8 @@ SELECT
|
|||
premium_expires_at,
|
||||
emoji_status_document_id,
|
||||
emoji_status_until,
|
||||
emoji_status_collectible_id,
|
||||
emoji_status_collectible,
|
||||
color_set,
|
||||
color,
|
||||
color_background_emoji_id,
|
||||
|
|
@ -165,6 +169,8 @@ RETURNING *;
|
|||
UPDATE users
|
||||
SET emoji_status_document_id = sqlc.arg(emoji_status_document_id)::bigint,
|
||||
emoji_status_until = sqlc.arg(emoji_status_until)::bigint,
|
||||
emoji_status_collectible_id = sqlc.narg(emoji_status_collectible_id)::bigint,
|
||||
emoji_status_collectible = sqlc.arg(emoji_status_collectible)::jsonb,
|
||||
updated_at = now()
|
||||
WHERE id = sqlc.arg(id)::bigint AND deleted_at IS NULL
|
||||
RETURNING *;
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ INSERT INTO user_update_events (
|
|||
folder_peers,
|
||||
story_payload,
|
||||
reaction_payload,
|
||||
emoji_status_payload,
|
||||
message_box_id,
|
||||
peer_type,
|
||||
peer_id,
|
||||
|
|
@ -40,6 +41,7 @@ INSERT INTO user_update_events (
|
|||
sqlc.arg(folder_peers)::jsonb,
|
||||
sqlc.arg(story_payload)::jsonb,
|
||||
sqlc.arg(reaction_payload)::jsonb,
|
||||
sqlc.arg(emoji_status_payload)::jsonb,
|
||||
sqlc.narg(message_box_id),
|
||||
sqlc.narg(peer_type)::text,
|
||||
sqlc.narg(peer_id)::bigint,
|
||||
|
|
@ -68,6 +70,7 @@ SELECT
|
|||
COALESCE(e.folder_peers::text, '[]')::text AS folder_peers_json,
|
||||
COALESCE(e.story_payload::text, '{}')::text AS story_payload_json,
|
||||
COALESCE(e.reaction_payload::text, '{}')::text AS reaction_payload_json,
|
||||
COALESCE(e.emoji_status_payload::text, '{}')::text AS emoji_status_payload_json,
|
||||
COALESCE(e.peer_type, '')::text AS event_peer_type,
|
||||
COALESCE(e.peer_id, 0)::bigint AS event_peer_id,
|
||||
e.filter_id,
|
||||
|
|
@ -341,6 +344,7 @@ SELECT
|
|||
COALESCE(e.folder_peers::text, '[]')::text AS folder_peers_json,
|
||||
COALESCE(e.story_payload::text, '{}')::text AS story_payload_json,
|
||||
COALESCE(e.reaction_payload::text, '{}')::text AS reaction_payload_json,
|
||||
COALESCE(e.emoji_status_payload::text, '{}')::text AS emoji_status_payload_json,
|
||||
COALESCE(e.peer_type, '')::text AS event_peer_type,
|
||||
COALESCE(e.peer_id, 0)::bigint AS event_peer_id,
|
||||
e.filter_id,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue