diff --git a/priv/repo/migrations/20221207235104_add_events_index.exs b/priv/repo/migrations/20221207235104_add_events_index.exs new file mode 100644 index 0000000000..f3d89a7a3a --- /dev/null +++ b/priv/repo/migrations/20221207235104_add_events_index.exs @@ -0,0 +1,16 @@ +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