Merge branch 'stable' into stable-sync/2.1.2
[akkoma] / priv / repo / migrations / 20200905082737_rename_await_up_timeout_in_connections_pool.exs
1 defmodule Pleroma.Repo.Migrations.RenameAwaitUpTimeoutInConnectionsPool do
2 use Ecto.Migration
3
4 def change do
5 with %Pleroma.ConfigDB{} = config <-
6 Pleroma.ConfigDB.get_by_params(%{group: :pleroma, key: :connections_pool}),
7 {timeout, value} when is_integer(timeout) <- Keyword.pop(config.value, :await_up_timeout) do
8 config
9 |> Ecto.Changeset.change(value: Keyword.put(value, :connect_timeout, timeout))
10 |> Pleroma.Repo.update()
11 end
12 end
13 end