Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Channels: Run TRUNCATE with alter_sync=2 (#4804)

Karl-Aksel Puulmannfc83040ec1ea
diff --git a/priv/data_migrations/AcquisitionChannel/sql/acquisition_channel_functions.sql.eex b/priv/data_migrations/AcquisitionChannel/sql/acquisition_channel_functions.sql.eex
index 72e97def4e..f324edf4de 100644
--- a/priv/data_migrations/AcquisitionChannel/sql/acquisition_channel_functions.sql.eex
+++ b/priv/data_migrations/AcquisitionChannel/sql/acquisition_channel_functions.sql.eex
@@ -11,7 +11,7 @@ ENGINE = MergeTree()
<% end %>
ORDER BY referrer_source;
-TRUNCATE TABLE acquisition_channel_source_category <%= @on_cluster_statement %>;
+TRUNCATE TABLE acquisition_channel_source_category SETTINGS alter_sync=2;
INSERT INTO acquisition_channel_source_category(referrer_source, category)
SELECT t.1 AS referrer_source, t.2 AS category
@@ -43,7 +43,7 @@ ENGINE = MergeTree()
<% end %>
ORDER BY referrer_source;
-TRUNCATE TABLE acquisition_channel_paid_sources <%= @on_cluster_statement %>;
+TRUNCATE TABLE acquisition_channel_paid_sources SETTINGS alter_sync=2;
INSERT INTO acquisition_channel_paid_sources(referrer_source)
SELECT arrayJoin({paid_sources:Array(String)}) AS referrer_source
diff --git a/priv/data_migrations/LocationsSync/sql/truncate-location-data-table.sql.eex b/priv/data_migrations/LocationsSync/sql/truncate-location-data-table.sql.eex
index 852d56c11f..8dee71cb48 100644
--- a/priv/data_migrations/LocationsSync/sql/truncate-location-data-table.sql.eex
+++ b/priv/data_migrations/LocationsSync/sql/truncate-location-data-table.sql.eex
@@ -1 +1 @@
-TRUNCATE TABLE IF EXISTS location_data <%= if @cluster? do %>ON CLUSTER '{cluster}'<% end %>
+TRUNCATE TABLE IF EXISTS location_data SETTINGS alter_sync=2