2022-02-25 22:11:42 -08:00
|
|
|
# Pleroma: A lightweight social networking server
|
2023-01-02 12:38:50 -08:00
|
|
|
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
2022-02-25 22:11:42 -08:00
|
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2019-10-08 06:27:42 -07:00
|
|
|
defmodule Pleroma.Repo.Migrations.DropUsersFollowing do
|
|
|
|
use Ecto.Migration
|
|
|
|
|
2019-10-10 07:11:34 -07:00
|
|
|
# had to disable these to be able to restore `following` index concurrently
|
|
|
|
# https://hexdocs.pm/ecto_sql/Ecto.Migration.html#index/3-adding-dropping-indexes-concurrently
|
2019-10-08 06:27:42 -07:00
|
|
|
@disable_ddl_transaction true
|
|
|
|
@disable_migration_lock true
|
|
|
|
|
|
|
|
def change do
|
|
|
|
drop(index(:users, [:following], concurrently: true, using: :gin))
|
|
|
|
|
|
|
|
alter table(:users) do
|
|
|
|
remove(:following, {:array, :string}, default: [])
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|