From 0319cfc23d88add5f2e3c6807788c2bdb7200bfd Mon Sep 17 00:00:00 2001 From: andy8zhao Date: Fri, 22 Aug 2014 00:04:07 -0400 Subject: [PATCH] fix static container column sync_table bug For static container column, "static" keyword is missing from cql "create table" statement. --- cqlengine/columns.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cqlengine/columns.py b/cqlengine/columns.py index 9297d3d8..056853ab 100644 --- a/cqlengine/columns.py +++ b/cqlengine/columns.py @@ -545,9 +545,9 @@ class BaseContainerColumn(Column): """ Returns a column definition for CQL table definition """ + static = "static" if self.static else "" db_type = self.db_type.format(self.value_type.db_type) - return '{} {}'.format(self.cql, db_type) - + return '{} {} {}'.format(self.cql, db_type, static) def _val_is_null(self, val): return not val @@ -703,7 +703,8 @@ class Map(BaseContainerColumn): self.key_type.db_type, self.value_type.db_type ) - return '{} {}'.format(self.cql, db_type) + static = "static" if self.static else "" + return '{} {} {}'.format(self.cql, db_type, static) def validate(self, value): val = super(Map, self).validate(value)