Can a ecto configuration use a Postgres schema, ie besides the 'public' schema?

config :friends, Friends.Repo,
  adapter: Ecto.Adapters.Postgres,
  schema: "notpublic"
  database: "friends_repo",
  username: "user",
  password: "pass",
  hostname: "localhost"

Ecto creates Postgres tables in the default public schema. Is it possible to add a schema as well?

3 Likes

Those are done via the @prefix "blah" attribute for your schemas, you can have different schemas in different prefixes (although ecto chokes a lot when using multiple prefixes so be careful).