mirror of
https://github.com/PostHog/posthog.git
synced 2024-12-01 12:21:02 +01:00
cef2af5e4c
* Add table for group_type_mapping * Remove materialized columns from events table schema These are not used and not needed w/ new mat columns work * WIP: Migration to add group analytics columns * Remove event table changes temporarily
16 lines
549 B
Python
16 lines
549 B
Python
from infi.clickhouse_orm import migrations
|
|
|
|
from posthog.settings import CLICKHOUSE_CLUSTER
|
|
|
|
already_materialized_columns = [
|
|
("properties_issampledevent", "isSampledEvent"),
|
|
("properties_currentscreen", "currentScreen"),
|
|
("properties_objectname", "objectName"),
|
|
]
|
|
|
|
operations = []
|
|
|
|
for column_name, property in already_materialized_columns:
|
|
statement = f"ALTER TABLE events ON CLUSTER {CLICKHOUSE_CLUSTER} COMMENT COLUMN IF EXISTS {column_name} 'column_materializer::{property}'"
|
|
operations.append(migrations.RunSQL(statement))
|