问题
In config/dev.exs
:
config :drupex, Drupex.Repo,
adapter: Ecto.Adapters.Postgres,
-- username, password, database, hostname, pool_size omitted --
config :drupex, Drupex.DrupalRepo,
adapter: Ecto.Adapters.Mysql,
-- username, password, database, hostname omitted --
In mix.exs
under defp deps do
I added {:mariaex, "~> 0.8.2"},
just after {:postgrex, ">= 0.0.0"}
. Finally in lib/drupex/repo.ex
I added
defmodule Drupex.DrupalRepo do
use Ecto.Repo, otp_app: :drupex
end
I ran mix deps.get
, mix deps.compile
now running mix
I get
** (ArgumentError) adapter Ecto.Adapters.Mysql was not compiled, ensure it is correct and it is included as a project dependency
回答1:
Turns out the adapter is called MySQL
and it is case sensitive. Changing to adapter: Ecto.Adapters.MySQL,
solved the problem.
来源:https://stackoverflow.com/questions/49825883/cross-db-ecto-config-failing