logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git

20180918182427_create_push_subscriptions.exs (697B)


  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. defmodule Pleroma.Repo.Migrations.CreatePushSubscriptions do
  5. use Ecto.Migration
  6. def change do
  7. create_if_not_exists table("push_subscriptions") do
  8. add(:user_id, references("users", on_delete: :delete_all))
  9. add(:token_id, references("oauth_tokens", on_delete: :delete_all))
  10. add(:endpoint, :string)
  11. add(:key_p256dh, :string)
  12. add(:key_auth, :string)
  13. add(:data, :map)
  14. timestamps()
  15. end
  16. create_if_not_exists(index("push_subscriptions", [:user_id, :token_id], unique: true))
  17. end
  18. end