1
0
Fork 0
mirror of https://framagit.org/framasoft/mobilizon.git synced 2024-12-22 16:03:25 +00:00
mobilizon/priv/repo/migrations/20210506080303_create_user_push_subscriptions.exs
Thomas Citharel 938f698b7a
Add webpush front-end support
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2021-06-04 13:33:12 +02:00

18 lines
559 B
Elixir

defmodule Mobilizon.Repo.Migrations.CreateUserPushSubscriptions do
use Ecto.Migration
def change do
create table(:user_push_subscriptions, primary_key: false) do
add(:id, :uuid, primary_key: true)
add(:user_id, references(:users, on_delete: :nothing), null: false)
add(:digest, :text, null: false)
add(:endpoint, :string, null: false)
add(:auth, :string, null: false)
add(:p256dh, :string, null: false)
timestamps()
end
create(unique_index(:user_push_subscriptions, [:user_id, :digest]))
end
end