owpengram-server/deploy/migrations/0120_bot_api_ephemeral_payload.down.sql
A f49c817def feat: sync ephemeral transient messages
Sync telesrv 570ccf8 (feat(ephemeral): implement Layer 228 transient messages).

Skipped telesrv docs changes per public sync rules; normalized the public appearance seed label.
2026-07-20 16:43:27 +08:00

13 lines
556 B
SQL

DELETE FROM public.bot_api_updates
WHERE ephemeral_payload IS NOT NULL;
DROP INDEX IF EXISTS public.bot_api_updates_ephemeral_version_unique;
DROP INDEX IF EXISTS public.bot_api_updates_message_source_unique;
ALTER TABLE public.bot_api_updates
DROP CONSTRAINT bot_api_updates_ephemeral_shape_check,
DROP COLUMN ephemeral_payload;
CREATE UNIQUE INDEX bot_api_updates_message_source_unique
ON public.bot_api_updates (bot_user_id, update_kind, peer_type, peer_id, message_id, source_pts)
WHERE update_kind IN ('message', 'edited_message');