Hi, I have an elixir project that needs to use Ecto:
then I create config
folder and config.exs
file: (elixir 1.13.1)
import Config
config :mishka_developer_tools, MishkaDeveloperTools.Repo,
database: System.get_env("DATABASE_NAME"),
username: System.get_env("DATABASE_USER"),
password: System.get_env("DATABASE_PASSWORD"),
hostname: System.get_env("DATABASE_HOST"),
pool_size: 10,
show_sensitive_data_on_connection_error: true
then create repo file:
defmodule MishkaDeveloperTools.Repo do
use Ecto.Repo,
otp_app: :mishka_developer_tools,
adapter: Ecto.Adapters.Postgres
end
and add it on my Application file:
defmodule MishkaDeveloperTools.Application do
use Application
@impl true
def start(_type, _args) do
children = [
MishkaDeveloperTools.Repo
]
opts = [strategy: :one_for_one, name: MishkaDeveloperTools.Supervisor]
Supervisor.start_link(children, opts)
end
end
but I have this error and every thing seems true:
warning: could not find Ecto repos in any of the apps: [:mishka_developer_tools].
You can avoid this warning by passing the -r flag or by setting the
repositories managed by those applications in your config/config.exs:
config :mishka_developer_tools, ecto_repos: [...]