I'm curious if the core team would consider as an intended use case or if 
anyone has successfully implemented multi-database configuration to 
implement postgres-schema-based, subdomain-driven multitenancy. I would 
love if a database.yml like the following…

production_default: &production_default
  <<: *default
  database: my_app_production
  migrations_paths: db/tenants

production:
  tenant_1:
    <<: *production_default
    schema_search_path: public,extensions,tenant_1
  tenant_2:
    <<: *production_default
    schema_search_path: public,extensions,tenant_2

…could properly set the appropriate connection with some 
connection-switching glue code.

I would love to move away from directly manipulating the schema_search_path 
from app code and overloading databases.rake tasks, but in my brief spike 
on using multi-database configuration as a trojan horse for multi-schema 
configuration, I got the sense I was headed towards pain.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-core/4fd27fd3-b9e1-43cb-9c40-fc63482043b4%40googlegroups.com.

Reply via email to