Search docs
Docs searchValidation rule
Back to Rule CatalogAP-DB-001DatabaseTenant discriminator column exists for same-schema model
Checks that same-schema multi-tenant tables include tenant discriminator evidence.
errorviolationNo auto-fix
How to fix
- Add the tenant discriminator column where required.
- Update schema artifacts and migrations.
- If the system uses a different tenant isolation model, update the architecture configuration and ADRs.
What it means
A same-schema tenant model is configured, but ArchPilot could not confirm tenant discriminator coverage.
Why it matters
Tenant discriminators are the foundation for keeping tenant data isolated in shared tables.
Common causes
- A table is missing tenantId or equivalent.
- Schema metadata is stale.
- The tenant model setting does not match the database design.
Example bad pattern
An orders table is shared across tenants but has no tenant_id column.Example good pattern
Shared tenant tables include tenant_id and application queries filter by it.Related files/config
db/sqlpackages/db/prisma/schema.prisma.archpilot/architecture.json
Related CLI commands
archpilot validatearchpilot validate --ci