Locations Schema
Locations manages place hierarchy and location typing used across operational workflows.
Namespace
These tables should move into the locations PostgreSQL schema.
locations.location_typeslocations.locations
Tables
locations.location_types
- Primary key:
id - Required fields:
tenant_id,name - Foreign key:
tenant_id -> platform.tenants.id - Unique key: (
tenant_id,name)`
locations.locations
- Primary key:
id - Required fields:
tenant_id,name,type_id - Optional field:
parent_id - Foreign keys:
tenant_id -> platform.tenants.idparent_id -> locations.locations.id(ON DELETE SET NULL)type_id -> locations.location_types.id(ON DELETE RESTRICT)
Relationship Notes
- Locations form a tenant-scoped place hierarchy.
- Location types classify places such as site, building, room, storage area, or other operational place categories.
- Assets reference locations for assignments, circulation, and repair context.
- This schema is distinct from
census: it inventories places rather than people or education records.