deploy/migrations/0015_user_update_events_web_page.up.sql
Rama main · réplica de lectura del repositorio original.
-- Link-preview async backfill (updateWebPage) adds the user_update_events event
-- type 'web_page': once a pending link-preview placeholder attached at send time
-- is resolved out of band, EditMessage's WebPageResolve mode replaces it in place
-- and appends a web_page durable event (associated by webPage id, not marked
-- "edited"). The 0001/0003 allowlists did not include it, so on real Postgres the
-- append is rejected by the CHECK constraint (SQLSTATE 23514); the memory store
-- has no constraint, so unit tests did not expose it.
ALTER TABLE public.user_update_events DROP CONSTRAINT IF EXISTS user_update_events_type_check;
ALTER TABLE public.user_update_events ADD CONSTRAINT user_update_events_type_check CHECK (
(event_type)::text = ANY (ARRAY[
'new_message', 'read_history_inbox', 'read_history_outbox', 'read_message_contents',
'edit_message', 'web_page', 'message_reactions', 'message_poll', 'draft_message', 'quick_replies',
'new_quick_reply', 'delete_quick_reply', 'quick_reply_message', 'delete_quick_reply_messages',
'contacts_reset', 'dialog_pinned', 'pinned_dialogs', 'pinned_messages', 'dialog_unread_mark',
'peer_settings', 'peer_story_blocked', 'delete_messages', 'dialog_filter', 'dialog_filter_order',
'dialog_filters', 'folder_peers', 'channel_view_forum_as_messages',
'channel_state', 'saved_dialog_pinned', 'pinned_saved_dialogs', 'story', 'read_stories',
'sent_story_reaction', 'new_story_reaction', 'noop',
'read_channel_discussion_inbox', 'read_channel_discussion_outbox'
]::text[])
);