Add events index
This commit is contained in:
parent
8c7bdf1dbb
commit
9a091a8d85
1 changed files with 16 additions and 0 deletions
16
priv/repo/migrations/20221207235104_add_events_index.exs
Normal file
16
priv/repo/migrations/20221207235104_add_events_index.exs
Normal 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
|
Loading…
Reference in a new issue