Merge remote-tracking branch 'origin/develop' into apps-api-endpoint
This commit is contained in:
commit
f5c3d45120
3865 changed files with 4840 additions and 12084 deletions
|
|
@ -14,9 +14,7 @@ defmodule Pleroma.Repo.Migrations.FillRecipientsInActivities do
|
|||
max = min + 10_000
|
||||
|
||||
execute("""
|
||||
update activities set recipients = array(select jsonb_array_elements_text(data->'to')) where id > #{
|
||||
min
|
||||
} and id <= #{max};
|
||||
update activities set recipients = array(select jsonb_array_elements_text(data->'to')) where id > #{min} and id <= #{max};
|
||||
""")
|
||||
|> IO.inspect()
|
||||
end)
|
||||
|
|
|
|||
|
|
@ -28,9 +28,7 @@ defmodule Pleroma.Repo.Migrations.InsertSkeletonsForDeletedUsers do
|
|||
{:ok, %{rows: ap_ids}} =
|
||||
Ecto.Adapters.SQL.query(
|
||||
Repo,
|
||||
"select distinct unnest(nonexistent_locals.recipients) from activities, lateral (select array_agg(recipient) as recipients from unnest(activities.recipients) as recipient where recipient similar to '#{
|
||||
instance_uri
|
||||
}/users/[A-Za-z0-9]*' and not(recipient in (select ap_id from users))) nonexistent_locals;",
|
||||
"select distinct unnest(nonexistent_locals.recipients) from activities, lateral (select array_agg(recipient) as recipients from unnest(activities.recipients) as recipient where recipient similar to '#{instance_uri}/users/[A-Za-z0-9]*' and not(recipient in (select ap_id from users))) nonexistent_locals;",
|
||||
[],
|
||||
timeout: :infinity
|
||||
)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
defmodule Pleroma.Repo.Migrations.RemoveMastofeSettingsFromUsers do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
alter table(:users) do
|
||||
remove_if_exists(:mastofe_settings, :map)
|
||||
end
|
||||
end
|
||||
end
|
||||
15
priv/repo/migrations/20211121000000_create_user_notes.exs
Normal file
15
priv/repo/migrations/20211121000000_create_user_notes.exs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
defmodule Pleroma.Repo.Migrations.CreateUserNotes do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create_if_not_exists table(:user_notes) do
|
||||
add(:source_id, references(:users, type: :uuid, on_delete: :delete_all))
|
||||
add(:target_id, references(:users, type: :uuid, on_delete: :delete_all))
|
||||
add(:comment, :string)
|
||||
|
||||
timestamps()
|
||||
end
|
||||
|
||||
create_if_not_exists(unique_index(:user_notes, [:source_id, :target_id]))
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
defmodule Pleroma.Repo.Migrations.ForcePinnedObjectsToExist do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
execute("UPDATE users SET pinned_objects = '{}' WHERE pinned_objects IS NULL")
|
||||
|
||||
alter table("users") do
|
||||
modify(:pinned_objects, :map, null: false, default: %{})
|
||||
end
|
||||
end
|
||||
end
|
||||
11
priv/repo/migrations/20211126191138_add_suggestions.exs
Normal file
11
priv/repo/migrations/20211126191138_add_suggestions.exs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
defmodule Pleroma.Repo.Migrations.AddSuggestions do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
alter table(:users) do
|
||||
add(:is_suggested, :boolean, default: false, null: false)
|
||||
end
|
||||
|
||||
create_if_not_exists(index(:users, [:is_suggested]))
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
defmodule Pleroma.Repo.Migrations.AddLastStatusAtToUsers do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
alter table(:users) do
|
||||
add(:last_status_at, :naive_datetime)
|
||||
end
|
||||
|
||||
create_if_not_exists(index(:users, [:last_status_at]))
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
defmodule Pleroma.Repo.Migrations.AddIsDiscoverableIndexToUsers do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create(index(:users, [:is_discoverable]))
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue