fix static container column sync_table bug

For static container column, "static" keyword is missing from cql
"create table" statement.
This commit is contained in:
andy8zhao
2014-08-22 00:04:07 -04:00
parent ad318166b2
commit 0319cfc23d

View File

@@ -545,9 +545,9 @@ class BaseContainerColumn(Column):
""" """
Returns a column definition for CQL table definition 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) 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): def _val_is_null(self, val):
return not val return not val
@@ -703,7 +703,8 @@ class Map(BaseContainerColumn):
self.key_type.db_type, self.key_type.db_type,
self.value_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): def validate(self, value):
val = super(Map, self).validate(value) val = super(Map, self).validate(value)