Add events index

This commit is contained in:
Alex Gleason 2022-12-07 18:01:42 -06:00
parent 8c7bdf1dbb
commit 9a091a8d85
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -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