1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Repo.Migrations.CreatePushSubscriptions do
9 create_if_not_exists table("push_subscriptions") do
10 add(:user_id, references("users", on_delete: :delete_all))
11 add(:token_id, references("oauth_tokens", on_delete: :delete_all))
12 add(:endpoint, :string)
13 add(:key_p256dh, :string)
14 add(:key_auth, :string)
20 create_if_not_exists(index("push_subscriptions", [:user_id, :token_id], unique: true))