diff --git a/lib/plausible/migration_utils.ex b/lib/plausible/migration_utils.ex index cfe3d729660c..5155885238f9 100644 --- a/lib/plausible/migration_utils.ex +++ b/lib/plausible/migration_utils.ex @@ -3,14 +3,10 @@ defmodule Plausible.MigrationUtils do Base module for to use in Clickhouse migrations """ - def on_cluster_statement(table) do - if(clustered_table?(table), do: "ON CLUSTER '#{cluster_name()}'", else: "") - end - - def clustered_table?(table) do - case Plausible.IngestRepo.query("SELECT 1 FROM system.replicas WHERE table = '#{table}'") do - {:ok, %{rows: []}} -> false - {:ok, _} -> true + def on_cluster_statement(_table) do + case cluster_name() do + {:ok, cluster} -> "ON CLUSTER '#{cluster}'" + _ -> "" end end