mirror of
https://git.pleroma.social/sjw/pleroma.git
synced 2024-12-25 15:15:26 +01:00
Extract host from ap_id, add index
This commit is contained in:
parent
9075b6d25b
commit
29c9c8d93b
@ -445,7 +445,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
|
||||
activity in query,
|
||||
where: fragment("not (? = ANY(?))", activity.actor, ^blocks),
|
||||
where: fragment("not (?->'to' \\?| ?)", activity.data, ^blocks),
|
||||
where: fragment("not (? ~ ANY(?))", activity.actor, ^domain_blocks)
|
||||
where: fragment("not (split_part(?, '/', 3) = ANY(?))", activity.actor, ^domain_blocks)
|
||||
)
|
||||
end
|
||||
|
||||
|
@ -0,0 +1,8 @@
|
||||
defmodule Pleroma.Repo.Migrations.CreateApidHostExtractionIndex do
|
||||
use Ecto.Migration
|
||||
@disable_ddl_transaction true
|
||||
|
||||
def change do
|
||||
create index(:activities, ["(split_part(actor, '/', 3))"], concurrently: true, name: :activities_hosts)
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user