· 7 years ago · Nov 14, 2018, 10:22 PM
1CREATE TABLE IF NOT EXISTS instagram.user_post (
2 user_id uuid,
3 post_id timeuuid,
4 tag text,
5 caption text,
6 PRIMARY KEY (user_id, post_id)
7 ) WITH CLUSTERING ORDER BY (post_id DESC);
8
9CREATE TABLE IF NOT EXISTS instagram.user_post_comment (
10 user_id uuid,
11 post_id timeuuid,
12 comment text,
13 PRIMARY KEY (user_id, post_id)
14) WITH CLUSTERING ORDER BY (post_id DESC);
15
16
17CREATE TABLE IF NOT EXISTS instagram.user_post_timeline (
18 user_id uuid,
19 post_id timeuuid,
20 caption text,
21 month text,
22 PRIMARY KEY ((user_id, month) post_id)
23) WITH CLUSTERING ORDER BY (post_id DESC);