diff options
Diffstat (limited to 'priv/repo')
3 files changed, 31 insertions, 0 deletions
| diff --git a/priv/repo/migrations/20200825061316_move_activity_expirations_to_oban.exs b/priv/repo/migrations/20200825061316_move_activity_expirations_to_oban.exs index cdc00d20b..a703af83f 100644 --- a/priv/repo/migrations/20200825061316_move_activity_expirations_to_oban.exs +++ b/priv/repo/migrations/20200825061316_move_activity_expirations_to_oban.exs @@ -4,6 +4,8 @@ defmodule Pleroma.Repo.Migrations.MoveActivityExpirationsToOban do    import Ecto.Query, only: [from: 2]    def change do +    Pleroma.Config.Oban.warn() +      Supervisor.start_link([{Oban, Pleroma.Config.get(Oban)}],        strategy: :one_for_one,        name: Pleroma.Supervisor diff --git a/priv/repo/migrations/20200907092050_move_tokens_expiration_into_oban.exs b/priv/repo/migrations/20200907092050_move_tokens_expiration_into_oban.exs index 832bd02a7..9e49ddacb 100644 --- a/priv/repo/migrations/20200907092050_move_tokens_expiration_into_oban.exs +++ b/priv/repo/migrations/20200907092050_move_tokens_expiration_into_oban.exs @@ -4,6 +4,8 @@ defmodule Pleroma.Repo.Migrations.MoveTokensExpirationIntoOban do    import Ecto.Query, only: [from: 2]    def change do +    Pleroma.Config.Oban.warn() +      Supervisor.start_link([{Oban, Pleroma.Config.get(Oban)}],        strategy: :one_for_one,        name: Pleroma.Supervisor diff --git a/priv/repo/migrations/20200910113106_remove_managed_config_from_db.exs b/priv/repo/migrations/20200910113106_remove_managed_config_from_db.exs new file mode 100644 index 000000000..e27a9ae48 --- /dev/null +++ b/priv/repo/migrations/20200910113106_remove_managed_config_from_db.exs @@ -0,0 +1,27 @@ +defmodule Pleroma.Repo.Migrations.RemoveManagedConfigFromDb do +  use Ecto.Migration +  import Ecto.Query +  alias Pleroma.ConfigDB +  alias Pleroma.Repo + +  def up do +    config_entry = +      from(c in ConfigDB, +        select: [:id, :value], +        where: c.group == ^:pleroma and c.key == ^:instance +      ) +      |> Repo.one() + +    if config_entry do +      {_, value} = Keyword.pop(config_entry.value, :managed_config) + +      config_entry +      |> Ecto.Changeset.change(value: value) +      |> Repo.update() +    end +  end + +  def down do +    :ok +  end +end | 
