social-networking-library/messages.cql

81 lines
2.7 KiB
SQL

CREATE TABLE messages_received (
recipient_id text,
message_id uuid,
body text,
deleted boolean,
from_id text,
from_name text,
opened boolean,
read boolean,
subject text,
timestamp timestamp,
with_attachments boolean,
addresses list<text>,
PRIMARY KEY (recipient_id, message_id)
) WITH CLUSTERING ORDER BY (message_id ASC)
AND additional_write_policy = '99p'
AND bloom_filter_fp_chance = 0.01
AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
AND cdc = false
AND comment = ''
AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold': '32', 'min_threshold': '4'}
AND compression = {'chunk_length_in_kb': '16', 'class': 'org.apache.cassandra.io.compress.LZ4Compressor'}
AND memtable = 'default'
AND crc_check_chance = 1.0
AND default_time_to_live = 0
AND extensions = {}
AND gc_grace_seconds = 864000
AND max_index_interval = 2048
AND memtable_flush_period_in_ms = 0
AND min_index_interval = 128
AND read_repair = 'BLOCKING'
AND speculative_retry = '99p';
CREATE INDEX message_received_deleted_idx ON messages_received (deleted);
CREATE INDEX message_received_id_idx ON messages_received (message_id);
CREATE INDEX message_received_read_idx ON messages_received (read);
CREATE INDEX message_received_timestamp_idx ON messages_received (timestamp);
CREATE TABLE messages_sent (
from_id text,
message_id uuid,
body text,
deleted boolean,
from_name text,
opened boolean,
read boolean,
subject text,
timestamp timestamp,
with_attachments boolean,
addresses list<text>,
PRIMARY KEY (from_id, message_id)
) WITH CLUSTERING ORDER BY (message_id ASC)
AND additional_write_policy = '99p'
AND bloom_filter_fp_chance = 0.01
AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
AND cdc = false
AND comment = ''
AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold': '32', 'min_threshold': '4'}
AND compression = {'chunk_length_in_kb': '16', 'class': 'org.apache.cassandra.io.compress.LZ4Compressor'}
AND memtable = 'default'
AND crc_check_chance = 1.0
AND default_time_to_live = 0
AND extensions = {}
AND gc_grace_seconds = 864000
AND max_index_interval = 2048
AND memtable_flush_period_in_ms = 0
AND min_index_interval = 128
AND read_repair = 'BLOCKING'
AND speculative_retry = '99p';
CREATE INDEX message_sent_deleted_idx ON messages_sent (deleted);
CREATE INDEX message_sent_id_idx ON messages_sent (message_id);
CREATE INDEX message_sent_read_idx ON messages_sent (read);
CREATE INDEX message_sent_timestamp_idx ON messages_sent (timestamp);