pleroma/priv/repo/migrations/20221207235104_add_events_index.exs
2022-12-07 18:01:42 -06:00

16 lines
347 B
Elixir

defmodule Pleroma.Repo.Migrations.AddEventsIndex do
use Ecto.Migration
@disable_ddl_transaction true
@disable_migration_lock true
def change do
create_if_not_exists(
index(:objects, ["(data->>'type')"],
where: "data->>'type' = 'Event'",
name: :objects_events,
concurrently: true
)
)
end
end