fix(activitypub): deduplicate account favourites
This commit is contained in:
parent
9a6c2f909d
commit
99befcaf1b
3 changed files with 82 additions and 0 deletions
|
|
@ -0,0 +1,20 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Pleroma.Repo.Migrations.AddActivityFavoritesLookupIndex do
|
||||
use Ecto.Migration
|
||||
|
||||
@disable_ddl_transaction true
|
||||
@disable_migration_lock true
|
||||
|
||||
def change do
|
||||
create_if_not_exists(
|
||||
index(:activities, [:actor, "associated_object_id(data)", "id DESC"],
|
||||
name: :activities_favorites_lookup_index,
|
||||
where: "data->>'type' = 'Like'",
|
||||
concurrently: true
|
||||
)
|
||||
)
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue