mirror of
https://github.com/PostHog/posthog.git
synced 2024-12-01 12:21:02 +01:00
fix: make the ALTER TABLE MODIFY QUERY run ON CLUSTER (#26411)
This commit is contained in:
parent
f255be2581
commit
2bd9f57c3d
@ -0,0 +1,6 @@
|
||||
from posthog.clickhouse.client.migration_tools import run_sql_with_exceptions
|
||||
from posthog.models.raw_sessions.sql import RAW_SESSION_TABLE_UPDATE_SQL
|
||||
|
||||
operations = [
|
||||
run_sql_with_exceptions(RAW_SESSION_TABLE_UPDATE_SQL),
|
||||
]
|
@ -409,10 +409,12 @@ AS
|
||||
|
||||
RAW_SESSION_TABLE_UPDATE_SQL = (
|
||||
lambda: """
|
||||
ALTER TABLE {table_name} MODIFY QUERY
|
||||
ALTER TABLE {table_name} ON CLUSTER '{cluster}'
|
||||
MODIFY QUERY
|
||||
{select_sql}
|
||||
""".format(
|
||||
table_name=f"{TABLE_BASE_NAME}_mv",
|
||||
cluster=settings.CLICKHOUSE_CLUSTER,
|
||||
select_sql=RAW_SESSION_TABLE_MV_SELECT_SQL(),
|
||||
)
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user