From 592880a215e8a62c9eb2da98e01cf66a578bf330 Mon Sep 17 00:00:00 2001 From: Vini Brasil Date: Thu, 16 Feb 2023 05:00:26 -0300 Subject: [PATCH] Move CH migration from clickhouse_repo/ to ingest_repo/ (#2683) This commit moves a migration that was created in `clickhouse_repo/` to its correct folder, `ingest_repo/`. The migration was created in 1cb07efe6dd800c906110858e55a6788cc2cdccf prior the read/write separation. --- ...remove_city_name_to_imported_locations.exs | 0 priv/repo/seeds.exs | 33 +++++++++---------- 2 files changed, 16 insertions(+), 17 deletions(-) rename priv/{clickhouse_repo => ingest_repo}/migrations/20230210140348_remove_city_name_to_imported_locations.exs (100%) 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 3c2f17a8a..d9cb1904c 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()