From b2afd366829b83059e40589a477586ae9d1e8eb2 Mon Sep 17 00:00:00 2001 From: James Greenhill Date: Tue, 5 Dec 2023 16:03:13 -0800 Subject: [PATCH] chore: remove add projection from migrations. Caused an outage previously (#19110) chore: remove add projection from migrations. Cause an outage previously --- .../0049_add_inserted_at_projection.py | 22 ------------------- 1 file changed, 22 deletions(-) delete mode 100644 posthog/clickhouse/migrations/0049_add_inserted_at_projection.py diff --git a/posthog/clickhouse/migrations/0049_add_inserted_at_projection.py b/posthog/clickhouse/migrations/0049_add_inserted_at_projection.py deleted file mode 100644 index f802f97e53cde..0000000000000 --- a/posthog/clickhouse/migrations/0049_add_inserted_at_projection.py +++ /dev/null @@ -1,22 +0,0 @@ -from posthog.clickhouse.client.migration_tools import run_sql_with_exceptions -from posthog.settings import CLICKHOUSE_CLUSTER - -ADD_PROJECTION_SQL = """ -ALTER TABLE sharded_events -ON CLUSTER '{cluster}' -ADD PROJECTION events_inserted_at_projection ( - SELECT * ORDER BY (team_id, inserted_at, event, cityHash64(distinct_id), cityHash64(uuid)) -); -""" - -MATERIALIZE_PROJECTION_SQL = """ -ALTER TABLE sharded_events -ON CLUSTER '{cluster}' -MATERIALIZE PROJECTION events_inserted_at_projection -IN PARTITION '202310'; -""" - -operations = [ - run_sql_with_exceptions(ADD_PROJECTION_SQL.format(cluster=CLICKHOUSE_CLUSTER)), - run_sql_with_exceptions(MATERIALIZE_PROJECTION_SQL.format(cluster=CLICKHOUSE_CLUSTER)), -]