Skip to content

Instantly share code, notes, and snippets.

@mzuvin
Last active April 28, 2020 19:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mzuvin/864b9a235993fb69a715c45f35d2ad34 to your computer and use it in GitHub Desktop.
Save mzuvin/864b9a235993fb69a715c45f35d2ad34 to your computer and use it in GitHub Desktop.

CREATE KEYSPACE streamkeyspace WITH replication = {'class':'SimpleStrategy', 'replication_factor' : 3};

CREATE TABLE IF NOT EXISTS streamkeyspace.user ( 
  id uuid PRIMARY KEY, 
  created_time timestamp, 
  username text, 
  password text, 
  email text
);

INSERT INTO streamkeyspace.user (id,username,password,email,created_time) VALUES (uuid(),'admin','admin123','admin@admin.com',dateof(now());

CREATE TABLE IF NOT EXISTS streamkeyspace.file ( 
  id uuid, 
  name text,
  content_length bigint,
  userid uuid,
  PRIMARY KEY(id,userid)
);
CREATE TABLE IF NOT EXISTS streamkeyspace.file_chunk (
chunk_id bigint,
file_id uuid,
content blob,
PRIMARY KEY(chunk_id,file_id)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment