What's Changed
- [x] Added `Tenancy` Facade
- [x] Tenancy now uses Facade for managing connections
- [x] Added `TenantContext`, now you can change the connection on the fly
python
from multitenancy.contexts import TenantContext
from multitenancy.models.Tenant import Tenant
tenant = Tenant.where('name', '=', 'tenant1').first()
with TenantContext(tenant=tenant) as ctx:
do whatever you like in tenant
...
migrate the database
ctx.migrate()
ctx.migrate_refresh()
ctx.migrate_rollback()
ctx.migrate_reset()
ctx.migrate_status()
seed the database
ctx.seed()
- [x] Other minor enhancements and bug fixes
**Full Changelog**: https://github.com/py-package/masonite-multitenancy/compare/0.0.4...0.0.5