Skip to content

System Tenants Schema

System tenants define the hard security boundary for nearly all Nexus objects.

Namespace

This table should move into the platform PostgreSQL schema.

  • platform.tenants

Tables

platform.tenants

Tenant root object.

  • Primary key: id
  • Required fields: name, tenant_admin_group_id, tenant_users_group_id
  • Unique field: name
  • Foreign keys:
    • id -> platform.user_groups.id
    • tenant_admin_group_id -> platform.user_groups.id
    • tenant_users_group_id -> platform.user_groups.id

The tenant object stays in platform because it is a System security boundary rather than a business-domain record.

Relationship Scope

The following core tables include a required tenant_id foreign key to platform.tenants.id:

  • platform.revoked_tokens
  • platform.user_groups
  • platform.user_group_memberships
  • assets.asset_models
  • assets.assets
  • assets.asset_assignments
  • assets.asset_circulations
  • assets.asset_repairs
  • assets.asset_manufacturers
  • assets.asset_types
  • census.persons
  • census.identities
  • census.schools
  • census.school_years
  • census.school_calendars
  • census.school_enrollments
  • census.school_employments
  • census.school_employment_assignments
  • locations.location_types
  • locations.locations
  • public.projects
  • public.issues

This means platform.tenants becomes the primary cross-schema anchor for the rest of the database.

platform.users is deliberately excluded from this list because users are now platform-global accounts rather than tenant-owned rows.

Seeded Shared Tenant

Current migrations keep a shared tenant with fixed ID:

  • 00000000000000000000000000

Recent migration history renames this from root/default naming to shared naming.

Nexus by McGuire Technology