如何在 django cassandra 模型中定义 varchar 字段。
from cassandra.cqlengine import columns
from django_cassandra_engine.models import DjangoCassandraModel
class ChatEvent(DjangoCassandraModel):
interview_id = columns.UUID(partition_key=True)
fire_time = columns.DateTime(primary_key=True, clustering_order="DESC")
id = columns.UUID(primary_key=True)
type = //to be varchar type
data = columns.Text(required=True)
created_by = columns.UUID(required=True)
本文档列出了所有数据类型,但没有 varchar 类型 https://docs.datastax.com/en/drivers/python/2.5/api/cassandra/cqlengine/columns.html#:~:text=Columns%20in %20your%20models%20map,one%20non%2Dprimary%20key%20column。