Initialization Cassandra scripts for Chat Server
Create keyspace
CREATE KEYSPACE genesys_chat_server
WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };
USE genesys_chat_server;Create tables
CREATE TABLE transcripts (
id text,
creatorid text,
transcript text,
PRIMARY KEY (id, creatorid) )
WITH CLUSTERING ORDER BY (creatorid ASC);
Table owner
CREATE TABLE owner (
id text,
ownership_start_time timeuuid,
creatorid text,
PRIMARY KEY (id, ownership_start_time) )
WITH CLUSTERING ORDER BY (ownership_start_time DESC);
Note: You can also specify default_time_to_live and gc_grace_seconds, as shown in the following examples, where 1209600 is the number of seconds in two weeks:
CREATE TABLE transcripts (
id text,
creatorid text,
transcript text,
PRIMARY KEY (id, creatorid) )
WITH CLUSTERING ORDER BY (creatorid ASC);
AND default_time_to_live = 1209600 AND gc_grace_seconds=1209600
Table owner
CREATE TABLE owner (
id text,
ownership_start_time timeuuid,
creatorid text,
PRIMARY KEY (id, ownership_start_time) )
WITH CLUSTERING ORDER BY (ownership_start_time DESC);
AND default_time_to_live = 1209600 AND gc_grace_seconds=1209600For more information, see Deploying Chat Server with Cassandra.
Comments or questions about this documentation? Contact us for support!
