fix: sync star gift profile pin order

Sync telesrv 6fcc6f0 (fix(stargifts): honor profile pin order).

Skipped telesrv docs changes per public sync rules.
This commit is contained in:
A 2026-07-19 13:20:36 +08:00
parent 14bf7d1e20
commit f88aa16a49
9 changed files with 263 additions and 24 deletions

View file

@ -0,0 +1,2 @@
DROP INDEX IF EXISTS public.peer_star_gifts_owner_profile_order_idx;
DROP INDEX IF EXISTS public.peer_star_gifts_owner_pinned_order_uniq;

View file

@ -0,0 +1,13 @@
CREATE UNIQUE INDEX peer_star_gifts_owner_pinned_order_uniq
ON public.peer_star_gifts(owner_peer_type, owner_peer_id, pinned_order)
WHERE pinned_order > 0;
CREATE INDEX peer_star_gifts_owner_profile_order_idx
ON public.peer_star_gifts(
owner_peer_type,
owner_peer_id,
(pinned_order = 0),
pinned_order,
id DESC
)
WHERE lifecycle_status = 'active';