Add user and hub to websub client subscriptions.
authorRoger Braun <roger@rogerbraun.net>
Thu, 27 Apr 2017 07:44:20 +0000 (09:44 +0200)
committerRoger Braun <roger@rogerbraun.net>
Thu, 27 Apr 2017 07:44:20 +0000 (09:44 +0200)
lib/pleroma/web/websub/websub_client_subscription.ex
priv/repo/migrations/20170427054757_add_user_and_hub.exs [new file with mode: 0644]

index 341e27c518b4cae23c147a50978f5192f7462659..c7a25ea227b49fc03909268c77dfb5e8d36dcb21 100644 (file)
@@ -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 (file)
index 0000000..4f9a520
--- /dev/null
@@ -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