-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathdb.cql
41 lines (36 loc) · 778 Bytes
/
db.cql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
CREATE KEYSPACE chat WITH REPLICATION = {'class':'SimpleStrategy', 'replication_factor':1};
CREATE TABLE users (
id uuid,
name text,
online bool,
image blob,
PRIMARY KEY (id)
)
CREATE TABLE users_ws (
name text,
hostname text,
PRIMARY KEY (name)
);
CREATE TABLE threads (
id text,
last_timeslice int,
PRIMARY KEY (id)
)
CREATE TABLE messages (
thread_id text,
timeslice int,
createdon timestamp,
user_id uuid,
user_name uuid,
message text,
versions set<timeuuid>,
reactions map<uuid, int>,
attached blob,
PRIMARY KEY ((thread_id,timeslice), createdon)
)
CREATE TABLE messages_version (
id timeuuid,
createdon timestamp,
json text,
PRIMARY KEY (createdon)
)