Skip to content

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

Move CH migration from clickhouse_repo/ to ingest_repo/ (#2683)

Vini Brasilce03b5ebd7f8
diff --git a/priv/clickhouse_repo/migrations/20230210140348_remove_city_name_to_imported_locations.exs b/priv/ingest_repo/migrations/20230210140348_remove_city_name_to_imported_locations.exs
similarity index 100%
rename from priv/clickhouse_repo/migrations/20230210140348_remove_city_name_to_imported_locations.exs
rename to priv/ingest_repo/migrations/20230210140348_remove_city_name_to_imported_locations.exs
diff --git a/priv/repo/seeds.exs b/priv/repo/seeds.exs
index 3c2f17a8af..d9cb1904c1 100644
--- a/priv/repo/seeds.exs
+++ b/priv/repo/seeds.exs
@@ -68,23 +68,22 @@ Enum.flat_map(-720..0, fn day_index ->
date = Date.add(Date.utc_today(), day_index)
number_of_events = 0..:rand.uniform(500)
- events =
- Enum.map(number_of_events, fn _ ->
- geolocation = Enum.random(geolocations)
+ Enum.map(number_of_events, fn _ ->
+ geolocation = Enum.random(geolocations)
- [
- domain: site.domain,
- hostname: site.domain,
- timestamp: put_random_time.(date),
- referrer_source: Enum.random(["", "Facebook", "Twitter", "DuckDuckGo", "Google"]),
- browser: Enum.random(["Edge", "Chrome", "Safari", "Firefox", "Vivaldi"]),
- browser_version: to_string(Enum.random(0..50)),
- screen_size: Enum.random(["Mobile", "Tablet", "Desktop", "Laptop"]),
- operating_system: Enum.random(["Windows", "macOS", "Linux"]),
- operating_system_version: to_string(Enum.random(0..15))
- ]
- |> Keyword.merge(geolocation)
- |> then(&Plausible.Factory.build(:pageview, &1))
- end)
+ [
+ domain: site.domain,
+ hostname: site.domain,
+ timestamp: put_random_time.(date),
+ referrer_source: Enum.random(["", "Facebook", "Twitter", "DuckDuckGo", "Google"]),
+ browser: Enum.random(["Edge", "Chrome", "Safari", "Firefox", "Vivaldi"]),
+ browser_version: to_string(Enum.random(0..50)),
+ screen_size: Enum.random(["Mobile", "Tablet", "Desktop", "Laptop"]),
+ operating_system: Enum.random(["Windows", "macOS", "Linux"]),
+ operating_system_version: to_string(Enum.random(0..15))
+ ]
+ |> Keyword.merge(geolocation)
+ |> then(&Plausible.Factory.build(:pageview, &1))
+ end)
end)
|> Plausible.TestUtils.populate_stats()