ref: 36d56ef4702983ceef8ac16de5efdf7dee78844e
schema/schema.cql
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
CREATE KEYSPACE yats WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '3'} AND durable_writes = true; CREATE TABLE metric ( id_client text, mtime timestamp, name text, value text, PRIMARY KEY ((id_client,name),mtime) ); CREATE TABLE event ( id_client text, etime timestamp, name text, PRIMARY KEY (id_client,etime) ); CREATE TABLE client ( id text, name text, created timestamp, PRIMARY KEY(id) ); CREATE TABLE metric_info ( id_client text, name text, description text, PRIMARY KEY (id_client,name) ); CREATE TABLE location ( hash text, lname text, lon double, lat double, code text, cdist double, PRIMARY KEY (code,cdist) ); CREATE TABLE location_label ( hash text, ltype text, name text, PRIMARY KEY (ltype,hash) ); // select * from location where lat='' and lon='' // select * from location where ltype='' and code='' order by cdist |