summaryrefslogtreecommitdiff
path: root/priv/repo/migrations/20170911123607_create_notifications.exs
diff options
context:
space:
mode:
Diffstat (limited to 'priv/repo/migrations/20170911123607_create_notifications.exs')
-rw-r--r--priv/repo/migrations/20170911123607_create_notifications.exs4
1 files changed, 2 insertions, 2 deletions
diff --git a/priv/repo/migrations/20170911123607_create_notifications.exs b/priv/repo/migrations/20170911123607_create_notifications.exs
index 5be809fb8..50de9c5f1 100644
--- a/priv/repo/migrations/20170911123607_create_notifications.exs
+++ b/priv/repo/migrations/20170911123607_create_notifications.exs
@@ -2,7 +2,7 @@ defmodule Pleroma.Repo.Migrations.CreateNotifications do
use Ecto.Migration
def change do
- create table(:notifications) do
+ create_if_not_exists table(:notifications) do
add :user_id, references(:users, on_delete: :delete_all)
add :activity_id, references(:activities, on_delete: :delete_all)
add :seen, :boolean, default: false
@@ -10,6 +10,6 @@ defmodule Pleroma.Repo.Migrations.CreateNotifications do
timestamps()
end
- create index(:notifications, [:user_id])
+ create_if_not_exists index(:notifications, [:user_id])
end
end