merge develop
This commit is contained in:
commit
604a83ae3e
767 changed files with 13811 additions and 9252 deletions
|
|
@ -0,0 +1,33 @@
|
|||
defmodule Pleroma.Repo.Migrations.AddRecipientsContainBlockedDomainsFunction do
|
||||
use Ecto.Migration
|
||||
@disable_ddl_transaction true
|
||||
|
||||
def up do
|
||||
statement = """
|
||||
CREATE OR REPLACE FUNCTION recipients_contain_blocked_domains(recipients varchar[], blocked_domains varchar[]) RETURNS boolean AS $$
|
||||
DECLARE
|
||||
recipient_domain varchar;
|
||||
recipient varchar;
|
||||
BEGIN
|
||||
FOREACH recipient IN ARRAY recipients LOOP
|
||||
recipient_domain = split_part(recipient, '/', 3)::varchar;
|
||||
|
||||
IF recipient_domain = ANY(blocked_domains) THEN
|
||||
RETURN TRUE;
|
||||
END IF;
|
||||
END LOOP;
|
||||
|
||||
RETURN FALSE;
|
||||
END;
|
||||
$$ LANGUAGE plpgsql;
|
||||
"""
|
||||
|
||||
execute(statement)
|
||||
end
|
||||
|
||||
def down do
|
||||
execute(
|
||||
"drop function if exists recipients_contain_blocked_domains(recipients varchar[], blocked_domains varchar[])"
|
||||
)
|
||||
end
|
||||
end
|
||||
7
priv/repo/migrations/20200526144426_add_apps_indexes.exs
Normal file
7
priv/repo/migrations/20200526144426_add_apps_indexes.exs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
defmodule Pleroma.Repo.Migrations.AddAppsIndexes do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create(index(:apps, [:client_id, :client_secret]))
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
defmodule Pleroma.Repo.Migrations.ChangeNotificationUserIndex do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
drop_if_exists(index(:notifications, [:user_id]))
|
||||
create_if_not_exists(index(:notifications, [:user_id, "id desc nulls last"]))
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue