Skip to main content

D9 — Tenant model uses HasDatabase (code-verified deviation from skill)

Architecture decision record, relocated verbatim from the retired single-file docs/tenancy/ decision log. Status, thematic clusters, and how to record a new ADR: the decision log index.

The skill says "remove HasDatabase", but dev-master's tenants:rls (CreateUserWithRLSPolicies) calls tenancy()->model()->database() to build the RLS user's connection config. The base Tenant model does not include HasDatabase, so our App\Models\Tenant must implement TenantWithDatabase + use HasDatabase or tenants:rls fails. This does not enable multi-DB — we register no CreateDatabase/ MigrateDatabase jobs; database() is used purely to derive the central connection config for the shared RLS user.


← Decision log index