Skip to content

How to use prefix for schema's name in the project #3

@stenionobres

Description

@stenionobres

Hello,

I'm make some tests with the apartmentex and I have a doubt.

I'm try to use a prefix configuration for a schema name e for one reason do not works very well, always the application use the default prefix "tenant_".

My project is a umbrella project and inside a config.exs of the projects that's have a Ecto dependence I put:

config :apartmentex, schema_prefix: "client_"

Unfortanely do not work. I did a search and I found out that the

https://groups.google.com/forum/#!msg/elixir-lang-talk/5yX9hBNEXe0/7UYWeTKmjaYJ

Using the strategy of the previous post the configuration works: config :tenant_prefix, :apartmentex, %{ schema_prefix: "client_" }

However I need change the call in apartmentex for: Application.get_env(:tenant_prefix, :apartmentex).schema_prefix

A another way is change the "key" :apartmentex for the my application name. Ex:

config :my_app, schema_prefix: "client_"

And change the call in apartmentex for Application.get_env(:my_app, :schema_prefix)

How should I proceed?

Sorry for english mistakes.

PS: I'm using Ecto 3.0. When the compatibility will be available in Hex?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions