aboutsummaryrefslogtreecommitdiff
path: root/priv/repo
diff options
context:
space:
mode:
authorHaelwenn <contact+git.pleroma.social@hacktivis.me>2020-09-08 11:26:12 +0000
committerHaelwenn <contact+git.pleroma.social@hacktivis.me>2020-09-08 11:26:12 +0000
commita08196ca680554315e088e9ea4191f292bbe2642 (patch)
treee38dad4a9fd0d566859755aec6c40f4f3a62fd2d /priv/repo
parent6a567a131ec04dbeb71012f2caeebf563ed453a4 (diff)
parentd34dc4a7469b97e28ca4fffc8b2387c937ab56d8 (diff)
downloadpleroma-fix/disable-favicons-in-tests.tar.gz
Merge branch 'develop' into 'fix/disable-favicons-in-tests'fix/disable-favicons-in-tests
# Conflicts: # config/test.exs
Diffstat (limited to 'priv/repo')
-rw-r--r--priv/repo/migrations/20200905082737_rename_await_up_timeout_in_connections_pool.exs13
-rw-r--r--priv/repo/migrations/20200905091427_rename_timeout_in_pools.exs19
2 files changed, 32 insertions, 0 deletions
diff --git a/priv/repo/migrations/20200905082737_rename_await_up_timeout_in_connections_pool.exs b/priv/repo/migrations/20200905082737_rename_await_up_timeout_in_connections_pool.exs
new file mode 100644
index 000000000..22c40663c
--- /dev/null
+++ b/priv/repo/migrations/20200905082737_rename_await_up_timeout_in_connections_pool.exs
@@ -0,0 +1,13 @@
+defmodule Pleroma.Repo.Migrations.RenameAwaitUpTimeoutInConnectionsPool do
+ use Ecto.Migration
+
+ def change do
+ with %Pleroma.ConfigDB{} = config <-
+ Pleroma.ConfigDB.get_by_params(%{group: :pleroma, key: :connections_pool}),
+ {timeout, value} when is_integer(timeout) <- Keyword.pop(config.value, :await_up_timeout) do
+ config
+ |> Ecto.Changeset.change(value: Keyword.put(value, :connect_timeout, timeout))
+ |> Pleroma.Repo.update()
+ end
+ end
+end
diff --git a/priv/repo/migrations/20200905091427_rename_timeout_in_pools.exs b/priv/repo/migrations/20200905091427_rename_timeout_in_pools.exs
new file mode 100644
index 000000000..bb2f50ecc
--- /dev/null
+++ b/priv/repo/migrations/20200905091427_rename_timeout_in_pools.exs
@@ -0,0 +1,19 @@
+defmodule Pleroma.Repo.Migrations.RenameTimeoutInPools do
+ use Ecto.Migration
+
+ def change do
+ with %Pleroma.ConfigDB{} = config <-
+ Pleroma.ConfigDB.get_by_params(%{group: :pleroma, key: :pools}) do
+ updated_value =
+ Enum.map(config.value, fn {pool, pool_value} ->
+ with {timeout, value} when is_integer(timeout) <- Keyword.pop(pool_value, :timeout) do
+ {pool, Keyword.put(value, :recv_timeout, timeout)}
+ end
+ end)
+
+ config
+ |> Ecto.Changeset.change(value: updated_value)
+ |> Pleroma.Repo.update()
+ end
+ end
+end