Add more saftey for test env

pull/479/head
Connor Rigby 2018-03-21 19:41:52 -07:00
parent a110bf2dc5
commit ef8dad89b3
2 changed files with 8 additions and 3 deletions

View File

@ -18,6 +18,7 @@ defmodule Farmbot.System.Init.Ecto do
repos = Application.get_env(:farmbot, :ecto_repos)
for repo <- repos do
Application.put_env(:farmbot, :repo_hack, repo)
setup(repo)
end
end

View File

@ -4,9 +4,13 @@ defmodule Farmbot.Repo.Migrations.FixNamespaces do
def change do
repo = Application.get_env(:farmbot, :repo_hack)
IO.puts "STARTING MIGRATION: #{repo}\n\n\n\n\n\n"
do_update(repo)
IO.puts "MIGRATION COMPLETE: #{repo}\n\n\n\n\n"
if repo do
IO.puts "STARTING MIGRATION: #{repo}\n\n\n\n\n\n"
do_update(repo)
IO.puts "MIGRATION COMPLETE: #{repo}\n\n\n\n\n"
else
IO.puts "Not migrating."
end
end
defp do_update(repo) do