Added all MergeTree engines supported in infi.clickhouse_orm

This commit is contained in:
M1ha 2018-11-22 11:09:38 +05:00
parent 084c218d2a
commit 9b02a49bc9
2 changed files with 10 additions and 2 deletions

View File

@ -34,6 +34,14 @@ class MergeTree(InsertOnlyEngineMixin, infi_engines.MergeTree):
pass
class ReplacingMergeTree(InsertOnlyEngineMixin, infi_engines.ReplacingMergeTree):
pass
class SummingMergeTree(InsertOnlyEngineMixin, infi_engines.SummingMergeTree):
pass
class CollapsingMergeTree(InsertOnlyEngineMixin, infi_engines.CollapsingMergeTree):
def get_final_versions(self, model_cls, objects):
"""

View File

@ -1,7 +1,7 @@
from infi.clickhouse_orm import fields
from django_clickhouse.clickhouse_models import ClickHouseModel
from django_clickhouse.engines import MergeTree, CollapsingMergeTree
from django_clickhouse.engines import ReplacingMergeTree, CollapsingMergeTree
from tests.models import TestModel
@ -13,7 +13,7 @@ class ClickHouseTestModel(ClickHouseModel):
created_date = fields.DateField()
value = fields.Int32Field()
engine = MergeTree('created_date', ('id',))
engine = ReplacingMergeTree('created_date', ('id',))
class ClickHouseCollapseTestModel(ClickHouseModel):