mobilizon/priv/repo/migrations/20210506080303_create_user_...

17 lines
472 B
Elixir
Raw Normal View History

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(:data, :map, null: false)
timestamps()
end
create(unique_index(:user_push_subscriptions, [:user_id, :digest]))
end
end