mirror of
https://github.com/PostHog/posthog.git
synced 2024-11-28 18:26:15 +01:00
19 lines
584 B
Python
19 lines
584 B
Python
|
from infi.clickhouse_orm import migrations
|
||
|
|
||
|
from ee.clickhouse.materialized_columns.columns import materialize
|
||
|
|
||
|
|
||
|
def create_materialized_columns(database):
|
||
|
try:
|
||
|
materialize("events", "$group_0", "$group_0")
|
||
|
materialize("events", "$group_1", "$group_1")
|
||
|
materialize("events", "$group_2", "$group_2")
|
||
|
materialize("events", "$group_3", "$group_3")
|
||
|
materialize("events", "$group_4", "$group_4")
|
||
|
except ValueError:
|
||
|
# Group is already materialized, skip
|
||
|
pass
|
||
|
|
||
|
|
||
|
operations = [migrations.RunPython(create_materialized_columns)]
|