You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Blocking #222
This PR is mostly a refactoring, but brings some breaking changes that I
think are worth the improvements in usability and extensibility.
Specifically, the problem I'm facing right now is updating the rake
tasks to be specific to a database, so for example `db:migrate:tenant`
should be named `db:migrate:primary` (or more generally,
`db:migrate:<DBNAME>`) so that if I have a secondary database it will
have its own rake tasks like `db:migrate:secondary`.
So the breaking change is around task names; however everything is still
a dependency of the Rails tasks `db:migrate`, `db:prepare`, `db:drop`,
and `db:reset` so it should be a huge deal for anybody (I hope).
- db:migrate:DBNAME replaces db:migrate:tenant and db:migrate:tenant:all
- it operates on all tenants by default
- if there are no tenants it will create a database for the default
tenant
- the ARTENANT env var can be specified to run against a specific tenant
- db:drop:DBNAME replaces db:drop:tenant
- it operates on all tenants by default
- NEW: the ARTENANT env var can be specified to run against a specific
tenant
- db:reset:DBNAME replaces db:reset:tenant
- it operates on all tenants by default
- NEW: the ARTENANT env var can be specified to run against a specific
tenant
- Tenanted::DatabaseTasks.base_config has been removed
Some additional changes:
- Tenanted::DatabaseTasks is now a class that takes a tenanted base
config as a constructor parameter. Yay for encapsulation.
- ActiveRecord::Tenanted.base_configs is a new method that returns all
the tenanted base configs for the current environment.
0 commit comments