Skip to content

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

Change Site schema: Add consolidated (boolean) field (#5737)

RobertJoonasbf587b05fd36
diff --git a/lib/plausible/data_migration/backfill_tracker_script_configuration.ex b/lib/plausible/data_migration/backfill_tracker_script_configuration.ex
index fcc28e1b13..c7ef3693af 100644
--- a/lib/plausible/data_migration/backfill_tracker_script_configuration.ex
+++ b/lib/plausible/data_migration/backfill_tracker_script_configuration.ex
@@ -44,7 +44,12 @@ defmodule Plausible.DataMigration.BackfillTrackerScriptConfiguration do
def process_batch(offset, now) do
sites =
Repo.all(
- from(s in Plausible.Site, order_by: [asc: :id], limit: @batch_size, offset: ^offset)
+ from(s in "sites",
+ order_by: [asc: :id],
+ limit: @batch_size,
+ offset: ^offset,
+ select: %{id: s.id, installation_meta: s.installation_meta}
+ )
)
if length(sites) > 0 do
diff --git a/lib/plausible/site.ex b/lib/plausible/site.ex
index d69793a421..55b85d8a41 100644
--- a/lib/plausible/site.ex
+++ b/lib/plausible/site.ex
@@ -22,6 +22,10 @@ defmodule Plausible.Site do
field :funnels_enabled, :boolean, default: true
field :legacy_time_on_page_cutoff, :date, default: ~D[1970-01-01]
+ on_ee do
+ field :consolidated, :boolean
+ end
+
field :ingest_rate_limit_scale_seconds, :integer, default: 60
# default is set via changeset/2
field :ingest_rate_limit_threshold, :integer