summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/pleroma/web/websub/websub_client_subscription.ex3
-rw-r--r--priv/repo/migrations/20170427054757_add_user_and_hub.exs10
2 files changed, 13 insertions, 0 deletions
diff --git a/lib/pleroma/web/websub/websub_client_subscription.ex b/lib/pleroma/web/websub/websub_client_subscription.ex
index 341e27c51..c7a25ea22 100644
--- a/lib/pleroma/web/websub/websub_client_subscription.ex
+++ b/lib/pleroma/web/websub/websub_client_subscription.ex
@@ -1,5 +1,6 @@
defmodule Pleroma.Web.Websub.WebsubClientSubscription do
use Ecto.Schema
+ alias Pleroma.User
schema "websub_client_subscriptions" do
field :topic, :string
@@ -7,6 +8,8 @@ defmodule Pleroma.Web.Websub.WebsubClientSubscription do
field :valid_until, :naive_datetime
field :state, :string
field :subscribers, {:array, :string}, default: []
+ field :hub, :string
+ belongs_to :user, User
timestamps()
end
diff --git a/priv/repo/migrations/20170427054757_add_user_and_hub.exs b/priv/repo/migrations/20170427054757_add_user_and_hub.exs
new file mode 100644
index 000000000..4f9a520bd
--- /dev/null
+++ b/priv/repo/migrations/20170427054757_add_user_and_hub.exs
@@ -0,0 +1,10 @@
+defmodule Pleroma.Repo.Migrations.AddUserAndHub do
+ use Ecto.Migration
+
+ def change do
+ alter table(:websub_client_subscriptions) do
+ add :hub, :string
+ add :user_id, references(:users)
+ end
+ end
+end