2021-12-28 11:42:08 +01:00
|
|
|
defmodule Mobilizon.Instances.Instance do
|
|
|
|
@moduledoc """
|
|
|
|
An instance representation
|
|
|
|
|
|
|
|
Using a MATERIALIZED VIEW underneath
|
|
|
|
"""
|
|
|
|
use Ecto.Schema
|
|
|
|
|
2022-04-07 18:37:44 +02:00
|
|
|
@type t :: %__MODULE__{
|
2022-05-02 12:08:00 +02:00
|
|
|
domain: String.t(),
|
2022-04-07 18:37:44 +02:00
|
|
|
event_count: non_neg_integer(),
|
|
|
|
person_count: non_neg_integer(),
|
|
|
|
group_count: non_neg_integer(),
|
|
|
|
followers_count: non_neg_integer(),
|
|
|
|
followings_count: non_neg_integer(),
|
|
|
|
reports_count: non_neg_integer(),
|
|
|
|
media_size: non_neg_integer()
|
|
|
|
}
|
|
|
|
|
2021-12-28 11:42:08 +01:00
|
|
|
@primary_key {:domain, :string, []}
|
|
|
|
schema "instances" do
|
|
|
|
field(:event_count, :integer)
|
|
|
|
field(:person_count, :integer)
|
|
|
|
field(:group_count, :integer)
|
|
|
|
field(:followers_count, :integer)
|
|
|
|
field(:followings_count, :integer)
|
|
|
|
field(:reports_count, :integer)
|
|
|
|
field(:media_size, :integer)
|
|
|
|
end
|
|
|
|
end
|