Skip to content

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

Teams setup schema (#4944)

hq15f1de88a0d0d
diff --git a/lib/plausible/teams/team.ex b/lib/plausible/teams/team.ex
index ebbf0bc185..76a2c2a8c4 100644
--- a/lib/plausible/teams/team.ex
+++ b/lib/plausible/teams/team.ex
@@ -25,6 +25,9 @@ defmodule Plausible.Teams.Team do
field :accept_traffic_until, :date
field :allow_next_upgrade_override, :boolean, default: false
+ field :setup_complete, :boolean, default: false
+ field :setup_at, :naive_datetime
+
embeds_one :grace_period, Plausible.Auth.GracePeriod, on_replace: :update
has_many :sites, Plausible.Site
diff --git a/test/support/factory.ex b/test/support/factory.ex
index 5126b3552d..30165d7075 100644
--- a/test/support/factory.ex
+++ b/test/support/factory.ex
@@ -6,7 +6,9 @@ defmodule Plausible.Factory do
def team_factory do
%Plausible.Teams.Team{
name: "My Team",
- trial_expiry_date: Timex.today() |> Timex.shift(days: 30)
+ trial_expiry_date: Timex.today() |> Timex.shift(days: 30),
+ setup_complete: true,
+ setup_at: NaiveDateTime.utc_now()
}
end