mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-07-09 01:56:08 +00:00
21 lines
695 B
MySQL
21 lines
695 B
MySQL
![]() |
-- Create table for chat documents
|
||
|
CREATE TABLE chat_table
|
||
|
(
|
||
|
chat_id TEXT PRIMARY KEY NOT NULL,
|
||
|
created_at BIGINT NOT NULL,
|
||
|
name TEXT NOT NULL DEFAULT ''
|
||
|
);
|
||
|
|
||
|
-- Create table for chat messages
|
||
|
CREATE TABLE chat_message_table
|
||
|
(
|
||
|
message_id BIGINT PRIMARY KEY NOT NULL,
|
||
|
chat_id TEXT NOT NULL,
|
||
|
content TEXT NOT NULL,
|
||
|
created_at BIGINT NOT NULL,
|
||
|
author_type BIGINT NOT NULL,
|
||
|
author_id TEXT NOT NULL,
|
||
|
reply_message_id BIGINT
|
||
|
);
|
||
|
CREATE INDEX idx_chat_messages_chat_id_message_id ON chat_message_table (chat_id, message_id);
|