9cd4710f7101f70611d99ee8a3fe16b808214afc
[anni] / priv / repo / migrations / 20190929201536_drop_subscription_if_exists.exs
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Repo.Migrations.DropSubscriptionIfExists do
6   use Ecto.Migration
7
8   def change do
9   end
10
11   def up do
12     drop_if_exists(index(:subscription_notifications, [:user_id]))
13     drop_if_exists(index(:subscription_notifications, ["id desc nulls last"]))
14     drop_if_exists(table(:subscription_notifications))
15   end
16
17   def down do
18     :ok
19   end
20 end