Test removed HTTP adapter
authorFloatingGhost <hannah@coffee-and-dreams.uk>
Sun, 11 Dec 2022 23:50:31 +0000 (23:50 +0000)
committerFloatingGhost <hannah@coffee-and-dreams.uk>
Sun, 11 Dec 2022 23:50:31 +0000 (23:50 +0000)
docs/docs/development/API/admin_api.md
lib/pleroma/config/deprecation_warnings.ex
priv/repo/migrations/20221211234352_remove_unused_indices.exs [new file with mode: 0644]
test/pleroma/config/deprecation_warnings_test.exs

index 211b5e736c5e4682e111b2211c68e7898092d782..79cb573ac1625684a21426500b3d0d6bd0597fe1 100644 (file)
@@ -1056,7 +1056,7 @@ Most of the settings will be applied in `runtime`, this means that you don't nee
 
 Example of setting without keyword in value:
 ```elixir
-config :tesla, :adapter, Tesla.Adapter.Hackney
+config :tesla, :adapter, {Tesla.Adapter.Finch, name: MyFinch}
 ```
 
 List of settings which support only full update by key:
index 972d1fb9669066cdbe447a3d808f8214603f3cbf..076b4cbf012c33c3badecf554624ca4f8c2a41bb 100644 (file)
@@ -213,6 +213,7 @@ defmodule Pleroma.Config.DeprecationWarnings do
 
   def check_http_adapter do
     http_adapter = Application.get_env(:tesla, :adapter)
+
     case http_adapter do
       {Tesla.Adapter.Finch, _} ->
         :ok
diff --git a/priv/repo/migrations/20221211234352_remove_unused_indices.exs b/priv/repo/migrations/20221211234352_remove_unused_indices.exs
new file mode 100644 (file)
index 0000000..facc85a
--- /dev/null
@@ -0,0 +1,11 @@
+defmodule Pleroma.Repo.Migrations.RemoveUnusedIndices do
+  use Ecto.Migration
+
+  def change do
+    drop_if_exists(
+      index(:activities, ["(data->>'actor')", "inserted_at desc"], name: :activities_actor_index)
+    )
+
+    drop_if_exists(index(:objects, ["(data->'tag')"], using: :gin, name: :objects_tags))
+  end
+end
index a5660189641d8fbaa3b4a1f94f06b172e3cd2ec6..b18267a7f436be42d9fb01cfb946903f5d793bfb 100644 (file)
@@ -281,10 +281,12 @@ defmodule Pleroma.Config.DeprecationWarningsTest do
   end
 
   test "check_http_adapter/0" do
-    clear_config([:tesla, :adapter], Gun)
+    Application.put_env(:tesla, :adapter, Gun)
 
     assert capture_log(fn ->
              DeprecationWarnings.check_http_adapter()
            end) =~ "Your config is using a custom tesla adapter"
+
+    Application.put_env(:tesla, :adapter, Tesla.Mock)
   end
 end