aboutsummaryrefslogtreecommitdiff
path: root/priv/repo
diff options
context:
space:
mode:
authorIvan Tashkinov <ivantashkinov@gmail.com>2020-09-14 21:51:25 +0300
committerIvan Tashkinov <ivantashkinov@gmail.com>2020-09-14 21:51:25 +0300
commit5687ff6c4a1186e08737156e784162376719bd39 (patch)
treeeb4d871eb7a3acb2ce3ccd5272695aa0faa971bf /priv/repo
parentd52eece03ab744fa7c18bbdf70e20b5bd9589f13 (diff)
parent39d769f25057dbaf89dc23d39941780bc65c2b06 (diff)
downloadpleroma-media-preview-proxy.tar.gz
Merge remote-tracking branch 'remotes/origin/develop' into media-preview-proxymedia-preview-proxy
Diffstat (limited to 'priv/repo')
-rw-r--r--priv/repo/migrations/20200825061316_move_activity_expirations_to_oban.exs2
-rw-r--r--priv/repo/migrations/20200907092050_move_tokens_expiration_into_oban.exs2
-rw-r--r--priv/repo/migrations/20200910113106_remove_managed_config_from_db.exs27
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