cassandra创建表空间和数据模型

编程

CREATE KEYSPACE msgkeyspace WITH REPLICATION = { "class" : "SimpleStrategy", "replication_factor" : 1 };

USE msgkeyspace;

CREATE TABLE msg (

app_id text,

owner_id text,

type_id text,

msg_id text,

msg text,

status int,

sign text,

created_time timestamp,

updated_time timestamp,

PRIMARY KEY ((app_id, owner_id,type_id),msg_id)

) WITH CLUSTERING ORDER BY (msg_id DESC);

INSERT INTO msg (app_id,owner_id,type_id,msg_id,msg,status,sign,created_time,updated_time) VALUES ("appId01","userId01","chat","123456789123456789","msgtext", 1,"sign","2006-01-02 15:04:05","2006-01-02 15:04:05");

 

以上是 cassandra创建表空间和数据模型 的全部内容, 来源链接: utcz.com/z/510401.html

回到顶部