feat(communication): add chat reactions emojis and images
This commit is contained in:
22
backend/db/migrations/0081_chat_media_reactions.sql
Normal file
22
backend/db/migrations/0081_chat_media_reactions.sql
Normal file
@@ -0,0 +1,22 @@
|
||||
ALTER TABLE communication_messages ADD COLUMN image jsonb;
|
||||
--> statement-breakpoint
|
||||
ALTER TABLE collaboration_messages ADD COLUMN image jsonb;
|
||||
--> statement-breakpoint
|
||||
ALTER TABLE collaboration_messages DROP CONSTRAINT collaboration_messages_body_check;
|
||||
--> statement-breakpoint
|
||||
ALTER TABLE collaboration_messages ADD CONSTRAINT collaboration_messages_body_check
|
||||
CHECK (length(body) <= 10000 AND (length(body) > 0 OR image IS NOT NULL));
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE communication_message_reactions (
|
||||
message_id bigint NOT NULL REFERENCES communication_messages(id) ON DELETE CASCADE,
|
||||
actor_id uuid NOT NULL REFERENCES auth_users(id) ON DELETE CASCADE,
|
||||
emoji text NOT NULL CHECK (length(emoji) BETWEEN 1 AND 16),
|
||||
PRIMARY KEY (message_id, actor_id, emoji)
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE collaboration_message_reactions (
|
||||
message_id uuid NOT NULL REFERENCES collaboration_messages(id) ON DELETE CASCADE,
|
||||
actor_id uuid NOT NULL REFERENCES collaboration_principals(id) ON DELETE CASCADE,
|
||||
emoji text NOT NULL CHECK (length(emoji) BETWEEN 1 AND 16),
|
||||
PRIMARY KEY (message_id, actor_id, emoji)
|
||||
);
|
||||
@@ -547,6 +547,13 @@
|
||||
"when": 1791158400000,
|
||||
"tag": "0080_staff_time_spans",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 78,
|
||||
"version": "7",
|
||||
"when": 1791244800000,
|
||||
"tag": "0081_chat_media_reactions",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user