Added a prefix (postgresql schema) from env variable into runtime.exs…#526
Added a prefix (postgresql schema) from env variable into runtime.exs…#526sachabertschibfs wants to merge 5 commits intopentacent:mainfrom
Conversation
… and also directly into the Oban migration.
|
Hey there, thanks for the PR! There are actually multiple Oban migrations (try looking for |
|
Oops, I missed those, I'll add them. |
|
I found a few more prefix to deal with. It should now migrate without problem and run. |
|
Hello @wmnnd , |
|
Hey there, the current implementation doesn't work because you've moved the schema settings to config.exs. However, config.exs is run only at compile-time so it won't be possible to change this at runtime (i.e. when starting as a container). |
|
I think the following code in runtime.exs should be sufficient (config merges keys automatically): db_schema = System.get_env("DB_SCHEMA")
if db_schema not in [nil, ""] do
config :keila, Keila.Repo,
migration_default_prefix: db_schema,
parameters: [search_path: db_schema]
config :keila, Oban, prefix: db_schema
endI suggest it you put it underneath the existing Could you give that a try? |
… and also directly into the Oban migration.