status-go/protocol/migrations/sqlite/1706520870_add_bridge_messages_table.up.sql
Michal Iskierko 73a5189398 feat(BridgeMessage): Add new type of chat message content: BridgeMessage
BridgeMessage is a type of chat message content which will be sent from  Matterbridge.
It contains fields:
- bridge name - depends on the used bridge, eg. "discord", "slack", etc...
- user name - username the message was received from
- content - message content
- user avatar
- message id
- parent message id - used in case of replies

Message is saved to a separated table: bridge_messages, similarly to discord messages.
The user_messages table is untouched.
bridge_messages table contains user_messages_id in order to join with user_messages table.

Issue #13098
2024-01-30 12:14:54 +01:00

14 lines
389 B
SQL

CREATE TABLE IF NOT EXISTS bridge_messages (
user_messages_id TEXT PRIMARY KEY NOT NULL,
bridge_name TEXT NOT NULL,
user_name TEXT NOT NULL,
user_avatar TEXT DEFAULT "",
user_id TEXT DEFAULT "",
content TEXT NOT NULL,
message_id TEXT DEFAULT "",
parent_message_id TEXT DEFAULT ""
);
CREATE INDEX idx_bridge_messages_user_messages_id
ON bridge_messages (user_messages_id);