Skip to content

Instantly share code, notes, and snippets.

@natbusa
Created October 3, 2013 11:34
Show Gist options
  • Save natbusa/6808405 to your computer and use it in GitHub Desktop.
Save natbusa/6808405 to your computer and use it in GitHub Desktop.
DROP TABLE followers;
CREATE TABLE followers (
followed_id text,
follower_id text,
created timestamp,
messages_count int,
likes_count int,
PRIMARY KEY ((followed_id, follower_id))
);
insert into followers (followed_id,follower_id , created, messages_count, likes_count) values ('123','567','2011-02-03T04:05:00+0000',2,5) ;
insert into followers (followed_id,follower_id, created, messages_count, likes_count) values ('123','890','2011-08-21T18:05:00+0000',1,2) ;
insert into followers (followed_id,follower_id, created, messages_count, likes_count) values ('222','567','2012-03-03T07:05:00+0000',3,0) ;
cqlsh:test> select * from followers;
followed_id | follower_id | created | likes_count | messages_count
-------------+-------------+--------------------------+-------------+----------------
222 | 567 | 2012-03-03 08:05:00+0100 | 0 | 3
123 | 890 | 2011-08-21 20:05:00+0200 | 2 | 1
123 | 567 | 2011-02-03 05:05:00+0100 | 5 | 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment