From 7a4228be5ab53d50fdc571323394363980546c09 Mon Sep 17 00:00:00 2001
From: Alexander Strizhakov <alex.strizhakov@gmail.com>
Date: Sun, 16 Jun 2019 10:01:15 +0000
Subject: [PATCH] fix for new instances

---
 lib/pleroma/config/transfer_task.ex | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/pleroma/config/transfer_task.ex b/lib/pleroma/config/transfer_task.ex
index 0d6ece807..a8cbfa52a 100644
--- a/lib/pleroma/config/transfer_task.ex
+++ b/lib/pleroma/config/transfer_task.ex
@@ -9,7 +9,8 @@ def start_link do
   end
 
   def load_and_update_env do
-    if Pleroma.Config.get([:instance, :dynamic_configuration]) do
+    if Pleroma.Config.get([:instance, :dynamic_configuration]) and
+         Ecto.Adapters.SQL.table_exists?(Pleroma.Repo, "config") do
       Pleroma.Repo.all(Config)
       |> Enum.each(&update_env(&1))
     end