我遵循了cassandra cqlengine教程。
import uuid
from cassandra.cqlengine import columns
from cassandra.cqlengine import connection
from datetime import datetime
from cassandra.cqlengine.management import sync_table
from cassandra.cqlengine.models import Model
class ExampleModel(Model):
example_id = columns.UUID(primary_key=True, default=uuid.uuid4)
example_type = columns.Integer(index=True)
created_at = columns.DateTime()
description = columns.Text(required=False)
connection.setup(['127.0.0.1'], "cqlengine", protocol_version=3)
sync_table(ExampleModel)但是,当我更改模型中的字段时,例如,如果我将字段描述从文本类型更改为整数类型,然后执行sync_table,我看不到更改反映在cassandra的tables模式中。如何解决这个问题呢?
发布于 2017-01-10 23:05:46
这里有两件事是错误的:
ALTER类型兼容性,这是here定义的。您尝试从Integer转换为Float的操作不兼容。https://stackoverflow.com/questions/41335391
复制相似问题