feat: sync rich text message support
This commit is contained in:
parent
4d3bbeabd8
commit
7c9d8dda16
41 changed files with 1164 additions and 94 deletions
|
|
@ -1759,7 +1759,7 @@ CREATE TABLE public.channel_messages (
|
|||
reply_markup jsonb DEFAULT '{}'::jsonb NOT NULL,
|
||||
from_boosts_applied integer DEFAULT 0 NOT NULL,
|
||||
rich_message jsonb DEFAULT '{}'::jsonb NOT NULL,
|
||||
CONSTRAINT channel_messages_content_check CHECK (((body <> ''::text) OR (action <> '{}'::jsonb) OR (media <> '{}'::jsonb))),
|
||||
CONSTRAINT channel_messages_content_check CHECK (((body <> ''::text) OR (action <> '{}'::jsonb) OR (media <> '{}'::jsonb) OR (rich_message <> '{}'::jsonb))),
|
||||
CONSTRAINT channel_messages_peer_type_check CHECK ((((from_peer_type)::text = ANY (ARRAY[('user'::character varying)::text, ('channel'::character varying)::text])) AND ((send_as_peer_type IS NULL) OR ((send_as_peer_type)::text = ANY (ARRAY[('user'::character varying)::text, ('channel'::character varying)::text]))) AND (((reply_to_peer_type)::text = ''::text) OR ((reply_to_peer_type)::text = ANY (ARRAY[('user'::character varying)::text, ('channel'::character varying)::text])))))
|
||||
);
|
||||
|
||||
|
|
@ -2472,7 +2472,7 @@ CREATE TABLE public.private_messages (
|
|||
reply_markup jsonb DEFAULT '{}'::jsonb NOT NULL,
|
||||
via_bot_id bigint DEFAULT 0 NOT NULL,
|
||||
rich_message jsonb DEFAULT '{}'::jsonb NOT NULL,
|
||||
CONSTRAINT private_messages_nonempty_body CHECK (((body <> ''::text) OR (media <> '{}'::jsonb)))
|
||||
CONSTRAINT private_messages_nonempty_body CHECK (((body <> ''::text) OR (media <> '{}'::jsonb) OR (rich_message <> '{}'::jsonb)))
|
||||
);
|
||||
|
||||
|
||||
|
|
@ -2596,6 +2596,7 @@ CREATE TABLE public.scheduled_messages (
|
|||
body text DEFAULT ''::text NOT NULL,
|
||||
entities jsonb DEFAULT '[]'::jsonb NOT NULL,
|
||||
media jsonb DEFAULT '{}'::jsonb NOT NULL,
|
||||
rich_message jsonb DEFAULT '{}'::jsonb NOT NULL,
|
||||
silent boolean DEFAULT false NOT NULL,
|
||||
noforwards boolean DEFAULT false NOT NULL,
|
||||
reply_to_msg_id integer DEFAULT 0 NOT NULL,
|
||||
|
|
|
|||
20
deploy/migrations/0050_rich_message_content_checks.down.sql
Normal file
20
deploy/migrations/0050_rich_message_content_checks.down.sql
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
ALTER TABLE public.channel_messages
|
||||
DROP CONSTRAINT IF EXISTS channel_messages_content_check;
|
||||
|
||||
ALTER TABLE public.channel_messages
|
||||
ADD CONSTRAINT channel_messages_content_check
|
||||
CHECK (
|
||||
body <> ''::text
|
||||
OR action <> '{}'::jsonb
|
||||
OR media <> '{}'::jsonb
|
||||
);
|
||||
|
||||
ALTER TABLE public.private_messages
|
||||
DROP CONSTRAINT IF EXISTS private_messages_nonempty_body;
|
||||
|
||||
ALTER TABLE public.private_messages
|
||||
ADD CONSTRAINT private_messages_nonempty_body
|
||||
CHECK (
|
||||
body <> ''::text
|
||||
OR media <> '{}'::jsonb
|
||||
);
|
||||
22
deploy/migrations/0050_rich_message_content_checks.up.sql
Normal file
22
deploy/migrations/0050_rich_message_content_checks.up.sql
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
ALTER TABLE public.channel_messages
|
||||
DROP CONSTRAINT IF EXISTS channel_messages_content_check;
|
||||
|
||||
ALTER TABLE public.channel_messages
|
||||
ADD CONSTRAINT channel_messages_content_check
|
||||
CHECK (
|
||||
body <> ''::text
|
||||
OR action <> '{}'::jsonb
|
||||
OR media <> '{}'::jsonb
|
||||
OR rich_message <> '{}'::jsonb
|
||||
);
|
||||
|
||||
ALTER TABLE public.private_messages
|
||||
DROP CONSTRAINT IF EXISTS private_messages_nonempty_body;
|
||||
|
||||
ALTER TABLE public.private_messages
|
||||
ADD CONSTRAINT private_messages_nonempty_body
|
||||
CHECK (
|
||||
body <> ''::text
|
||||
OR media <> '{}'::jsonb
|
||||
OR rich_message <> '{}'::jsonb
|
||||
);
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
ALTER TABLE public.scheduled_messages
|
||||
DROP COLUMN IF EXISTS rich_message;
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
ALTER TABLE public.scheduled_messages
|
||||
ADD COLUMN IF NOT EXISTS rich_message jsonb DEFAULT '{}'::jsonb NOT NULL;
|
||||
Loading…
Add table
Add a link
Reference in a new issue