First
[anni] / priv / repo / migrations / 20191008132427_drop_users_following.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.DropUsersFollowing do
6   use Ecto.Migration
7
8   # had to disable these to be able to restore `following` index concurrently
9   # https://hexdocs.pm/ecto_sql/Ecto.Migration.html#index/3-adding-dropping-indexes-concurrently
10   @disable_ddl_transaction true
11   @disable_migration_lock true
12
13   def change do
14     drop(index(:users, [:following], concurrently: true, using: :gin))
15
16     alter table(:users) do
17       remove(:following, {:array, :string}, default: [])
18     end
19   end
20 end