Merge branch 'account-notes' into 'develop'
[akkoma] / priv / repo / migrations / 20180429094642_create_lists.exs
index 64c62250e2502dd00f87147959f29eccfc726d5c..e1eb7e4266206d635c8f28c31a9f82fa6e9b4131 100644 (file)
@@ -2,14 +2,14 @@ defmodule Pleroma.Repo.Migrations.CreateLists do
   use Ecto.Migration
 
   def change do
-    create table(:lists) do
-      add :user_id, references(:users, on_delete: :delete_all)
-      add :title, :string
-      add :following, {:array, :string}
+    create_if_not_exists table(:lists) do
+      add(:user_id, references(:users, on_delete: :delete_all))
+      add(:title, :string)
+      add(:following, {:array, :string})
 
       timestamps()
     end
 
-    create index(:lists, [:user_id])
+    create_if_not_exists(index(:lists, [:user_id]))
   end
 end