5252- implement ` AR::Tenanted::DatabaseConfigurations::RootConfig ` (name?)
5353 - [x] create the specialized RootConfig for ` tenanted: true ` databases
5454 - [x] RootConfig disables database tasks initially
55- - [ ] ` #database_path_for(tenant_name) `
55+ - [x] ` #database_path_for(tenant_name) `
56+ - [ ] bucketed database paths
5657 - [ ] ` #tenants ` returns all the tenants on disk (for iteration)
5758
5859- implement ` AR::Tenanted::DatabaseConfigurations::TenantConfig ` (name?)
@@ -69,17 +70,21 @@ TODO:
6970 - [ ] should error if self is not an abstract base class or if target is not tenanted abstract base class
7071 - [x] ` tenant_config_name ` and ` .tenanted? `
7172 - [ ] ` .tenanted_class ` nil or the abstract base class
72- - [ ] all the creation and schema migration complications (we have existing tests for this)
73- - think about race conditions here, maybe use a file lock to figure it out
74- - running migrations (they are done in a transaction, but the second thread's migration may fail resulting in a 500?)
75- - loading schemas (if the first thread loads the schema and inserts data, can the second thread accidentally drop/load causing data loss?)
73+ - [x] shared connection pools
74+ - [x] all the creation and schema migration complications (we have existing tests for this)
75+ accidentally drop/load causing data loss?)
7676 - [ ] feature to turn off automatic creation/migration
7777 - make sure we pay attention to Rails.config.active_record.migration_error when we turn off auto-migrating
7878 - thinking
7979 - should there be a global singleton ` Tenant ` ? I'm not sure we need it or the limitations of a global.
8080 - if we do, though, then ` .tenanted ` should set ` Tenant.base_class= `
8181 - and we need to add checks that ` .tenanted ` is called only ONCE in the application
8282
83+ - [ ] think about race conditions with database creation and schema migrations
84+ - maybe use a file lock to figure it out
85+ - running migrations (they are done in a transaction, but the second thread's migration may fail resulting in a 500?)
86+ - loading schemas (if the first thread loads the schema and inserts data, can the second thread
87+
8388- database tasks
8489 - [ ] RootConfig should conditionally re-enable database tasks ... when AR_TENANT is present?
8590 - [ ] make ` db:migrate:tenants ` iterate over all the tenants on disk
0 commit comments