websub_client_subscription.ex 586 Bytes
Newer Older
1
# Pleroma: A lightweight social networking server
kaniini's avatar
kaniini committed
2
# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
3 4
# SPDX-License-Identifier: AGPL-3.0-only

5 6
defmodule Pleroma.Web.Websub.WebsubClientSubscription do
  use Ecto.Schema
7
  alias Pleroma.User
8 9

  schema "websub_client_subscriptions" do
lain's avatar
lain committed
10 11
    field(:topic, :string)
    field(:secret, :string)
rinpatch's avatar
rinpatch committed
12
    field(:valid_until, :naive_datetime_usec)
lain's avatar
lain committed
13 14 15
    field(:state, :string)
    field(:subscribers, {:array, :string}, default: [])
    field(:hub, :string)
href's avatar
href committed
16
    belongs_to(:user, User, type: Pleroma.FlakeId)
17 18 19 20

    timestamps()
  end
end