tenant


Description

{“what”:“A distinct customer or organization with its own data partition.”,“why”:“Enables multi-tenancy; without it, data from different customers would be indistinguishable.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T04:13:30.253021983+00:00”}

Columns

Column Type Size Nulls Auto Default Children Parents Comments
id int4 10 √ null
core_user.tenant_id fk_core_user_tenant_id R

{“what”:“Integer primary key, unique per tenant.”,“why”:“Referenced by other tables as tenant_id to associate rows.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T04:13:30.288851331+00:00”}

name varchar 254 null

{“what”:“Display name for the tenant, e.g., ‘Acme Corp’.”,“why”:“Shown in UI and reports; without it, tenants are only numbers.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T04:13:30.321847844+00:00”}

slug varchar 254 null

{“what”:“URL-safe unique string, e.g., ‘acme-corp’.”,“why”:“Used in API paths and subdomains; without it, routing would need numeric IDs.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T04:13:30.348634225+00:00”}

is_active bool 1 true

{“what”:“Boolean flag; true means tenant is enabled.”,“why”:“Allows disabling a tenant without deleting data; without it, deactivation would require removal.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T04:13:30.393754696+00:00”}

updated_at timestamptz 35,6 null

{“what”:“Timestamp of last row update, timezone-aware.”,“why”:“Supports change tracking and cache invalidation; without it, stale data is undetectable.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T04:13:30.405001011+00:00”}

created_at timestamptz 35,6 null

{“what”:“Timestamp when tenant was created, timezone-aware.”,“why”:“Provides tenant age for lifecycle analysis; without it, onboarding date is unknown.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T04:13:30.418042876+00:00”}

attributes text 2147483647 √ null

{“what”:“Text field for JSON or key-value configuration.”,“why”:“Stores tenant-specific settings without schema migration; without it, custom fields require ALTER TABLE.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T04:13:30.433264016+00:00”}

tenant_collection_id int4 10 null

{“what”:“Integer foreign key to a tenant collection group.”,“why”:“Groups tenants for bulk operations; without it, collections cannot be assigned.”,“by”:“fleet-annotator-worker”,“at”:“2026-09-23T04:13:30.446846850+00:00”}

Indexes

Constraint Name Type Sort Column(s)
tenant_pkey Primary key Asc id
tenant_name_key Must be unique Asc name
tenant_slug_key Must be unique Asc slug

Relationships