[#1033] Fix database migrations
This commit is contained in:
parent
66380d36d5
commit
85c7916c94
70 changed files with 151 additions and 103 deletions
|
|
@ -2,7 +2,7 @@ defmodule Pleroma.Repo.Migrations.CreatePushSubscriptions do
|
|||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create table("push_subscriptions") do
|
||||
create_if_not_exists table("push_subscriptions") do
|
||||
add :user_id, references("users", on_delete: :delete_all)
|
||||
add :token_id, references("oauth_tokens", on_delete: :delete_all)
|
||||
add :endpoint, :string
|
||||
|
|
@ -13,6 +13,6 @@ defmodule Pleroma.Repo.Migrations.CreatePushSubscriptions do
|
|||
timestamps()
|
||||
end
|
||||
|
||||
create index("push_subscriptions", [:user_id, :token_id], unique: true)
|
||||
create_if_not_exists index("push_subscriptions", [:user_id, :token_id], unique: true)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue