Created
June 21, 2014 10:33
-
-
Save joscas/65f5c5af1ed5b8c12f49 to your computer and use it in GitHub Desktop.
CQL Commands for a Cassandra based Chat App
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cqlsh <<CQL | |
CREATE KEYSPACE chat_app WITH REPLICATION = {'class':'SimpleStrategy', 'replication_factor':1}; | |
USE chat_app; | |
CREATE TABLE chat_messages ( | |
message_id uuid, | |
from_user text, | |
to_user text, | |
body text, | |
class text, | |
time timeuuid, | |
PRIMARY KEY ((from_user, to_user), time) | |
) WITH CLUSTERING ORDER BY (time ASC); | |
CREATE INDEX chat_messages_to_user ON chat_messages (to_user); | |
CREATE INDEX chat_messages_class ON chat_messages (class); | |
CQL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment