999f87e3b02946a62ad8fb813bc2511133026d8e
[anni] / priv / repo / migrations / 20171109091239_add_actor_to_activity.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.AddActorToActivity do
6   use Ecto.Migration
7
8   @disable_ddl_transaction true
9
10   def up do
11     alter table(:activities) do
12       add(:actor, :string)
13     end
14
15     create(index(:activities, [:actor, "id DESC NULLS LAST"], concurrently: true))
16   end
17
18   def down do
19     drop_if_exists(index(:activities, [:actor, "id DESC NULLS LAST"]))
20
21     alter table(:activities) do
22       remove(:actor)
23     end
24   end
25 end