Remove MastoFE settings from users table

This commit is contained in:
Sean King 2021-04-15 23:33:24 -06:00
parent 8afa3f2d1b
commit ca79aab0bf
No known key found for this signature in database
GPG key ID: 510C52BACD6E7257
3 changed files with 9 additions and 11 deletions

View file

@ -123,7 +123,6 @@ defmodule Pleroma.User do
field(:is_moderator, :boolean, default: false)
field(:is_admin, :boolean, default: false)
field(:show_role, :boolean, default: true)
field(:mastofe_settings, :map, default: nil)
field(:uri, ObjectValidators.Uri, default: nil)
field(:hide_followers_count, :boolean, default: false)
field(:hide_follows_count, :boolean, default: false)
@ -1702,7 +1701,6 @@ defmodule Pleroma.User do
ap_enabled: false,
is_moderator: false,
is_admin: false,
mastofe_settings: nil,
mascot: nil,
emoji: %{},
pleroma_settings_store: %{},
@ -2313,13 +2311,6 @@ defmodule Pleroma.User do
|> update_and_set_cache()
end
def mastodon_settings_update(user, settings) do
user
|> cast(%{mastofe_settings: settings}, [:mastofe_settings])
|> validate_required([:mastofe_settings])
|> update_and_set_cache()
end
@spec confirmation_changeset(User.t(), keyword()) :: Changeset.t()
def confirmation_changeset(user, set_confirmation: confirmed?) do
params =

View file

@ -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

View file

@ -1631,7 +1631,6 @@ defmodule Pleroma.UserTest do
ap_enabled: true,
is_moderator: true,
is_admin: true,
mastofe_settings: %{"a" => "b"},
mascot: %{"a" => "b"},
emoji: %{"a" => "b"},
pleroma_settings_store: %{"q" => "x"},
@ -1673,7 +1672,6 @@ defmodule Pleroma.UserTest do
ap_enabled: false,
is_moderator: false,
is_admin: false,
mastofe_settings: nil,
mascot: nil,
emoji: %{},
pleroma_settings_store: %{},