Remove subscription_notifications table if it existed
authorrinpatch <rinpatch@sdf.org>
Sun, 29 Sep 2019 20:52:40 +0000 (23:52 +0300)
committerrinpatch <rinpatch@sdf.org>
Sun, 29 Sep 2019 20:52:40 +0000 (23:52 +0300)
Followup to !1741

priv/repo/migrations/20190929201536_drop_subscription_if_exists.exs [new file with mode: 0644]

diff --git a/priv/repo/migrations/20190929201536_drop_subscription_if_exists.exs b/priv/repo/migrations/20190929201536_drop_subscription_if_exists.exs
new file mode 100644 (file)
index 0000000..bbf70f7
--- /dev/null
@@ -0,0 +1,16 @@
+defmodule Pleroma.Repo.Migrations.DropSubscriptionIfExists do
+  use Ecto.Migration
+
+  def change do
+
+  end
+
+  def up do
+    drop_if_exists(index(:subscription_notifications, [:user_id]))
+    drop_if_exists(index(:subscription_notifications, ["id desc nulls last"]))
+    drop_if_exists(table(:subscription_notifications))
+  end
+  def down do
+    :ok
+  end
+end