Skip to content

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

Wrap data migration using with_repo to ensure ClickhouseRepo is running (#4190)

ruslandoga97e0255a2ba7
diff --git a/priv/repo/migrations/20240528115149_migrate_site_imports.exs b/priv/repo/migrations/20240528115149_migrate_site_imports.exs
index cf1c6425d2..ac53645883 100644
--- a/priv/repo/migrations/20240528115149_migrate_site_imports.exs
+++ b/priv/repo/migrations/20240528115149_migrate_site_imports.exs
@@ -4,7 +4,10 @@ defmodule Plausible.Repo.Migrations.MigrateSiteImports do
def up do
if ce?() do
- Plausible.DataMigration.SiteImports.run(dry_run?: false)
+ {:ok, _, _} =
+ Ecto.Migrator.with_repo(Plausible.ClickhouseRepo, fn _repo ->
+ Plausible.DataMigration.SiteImports.run(dry_run?: false)
+ end)
end
end