forked from AkkomaGang/akkoma
Extract host from ap_id, add index
This commit is contained in:
parent
9075b6d25b
commit
29c9c8d93b
2 changed files with 9 additions and 1 deletions
|
@ -445,7 +445,7 @@ defp restrict_blocked(query, %{"blocking_user" => %User{info: info}}) do
|
||||||
activity in query,
|
activity in query,
|
||||||
where: fragment("not (? = ANY(?))", activity.actor, ^blocks),
|
where: fragment("not (? = ANY(?))", activity.actor, ^blocks),
|
||||||
where: fragment("not (?->'to' \\?| ?)", activity.data, ^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
|
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 a new issue