-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.cql
38 lines (32 loc) · 843 Bytes
/
schema.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
CREATE KEYSPACE IF NOT EXISTS mirrorbot
WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}
AND durable_writes = true;
USE mirrorbot;
CREATE TABLE IF NOT EXISTS mirror_channels (
id uuid,
friendly_name text,
private boolean,
PRIMARY KEY (id)
);
CREATE TABLE IF NOT EXISTS linked_mirror_channels (
service text,
mirror_channel uuid,
service_channel text,
stream_offset smallint,
PRIMARY KEY (service, mirror_channel, service_channel)
);
CREATE TABLE IF NOT EXISTS roles (
mirror_channel uuid,
user text,
role text,
scope text,
PRIMARY KEY (mirror_channel, user, scope)
);
CREATE INDEX ON roles((mirror_channel), role);
CREATE TABLE IF NOT EXISTS usercache (
user text,
service text,
username text,
avatar blob,
PRIMARY KEY (service, user)
);