This commit is contained in:
2024-10-13 13:31:58 +04:00
commit aec8d7ed48
54 changed files with 2827 additions and 0 deletions

View File

@ -0,0 +1 @@
DROP TABLE IF EXISTS messages;

View File

@ -0,0 +1,8 @@
CREATE TABLE IF NOT EXISTS messages (
chat_id UUID, -- Partition key
user_id UUID,
content text, -- Clustering column
type text, -- Clustering column
created_at timestamp, -- Clustering column
PRIMARY KEY (chat_id, created_at, content, type)
) WITH CLUSTERING ORDER BY (created_at DESC);

View File

@ -0,0 +1 @@
DROP TABLE IF EXISTS user_chats;

View File

@ -0,0 +1,7 @@
CREATE TABLE IF NOT EXISTS user_chats (
user_id UUID, -- Partition key
chat_id UUID, -- Clustering column
blocked boolean,
created_at timestamp,
PRIMARY KEY (user_id, created_at, chat_id, blocked)
);