Adventure Labs Logo
Scout Docs

Maintenance Requests

Maintenance requests targeting exactly one of a device or a part

Column NameData TypeConstraints
idbigintNOT NULL
device_idbigintFK -> devices
part_idbigintFK -> parts
defect_timestamptimestamp with time zoneNOT NULL
creator_user_iduuidFK -> users
created_attimestamp with time zoneDEFAULT now() NOT NULL
descriptiontextNOT NULL
imagetext
remediation_notestext
remediation_completed_attimestamp with time zone
remediation_completed_user_iduuidFK -> users
updated_by_user_iduuidFK -> users
updated_attimestamp with time zone
is_serviceablebooleanDEFAULT true NOT NULL

Exactly one of device_id or part_id is set (maintenance_requests_exactly_one_target).

Security Policies (RLS)

RLS enabled. Scope: Access resolved via maintenance_request_access from the target's device/part herd.

Operationhas_herd_ability ability keyOther paths
SELECTmaintenance_requests.readTarget device API key, or approved gateway in the same herd
INSERTmaintenance_requests.writeTarget device API key, or approved gateway in the same herd
UPDATEmaintenance_requests.writeTarget device API key, or approved gateway in the same herd
DELETEmaintenance_requests.writeTarget device API key, or approved gateway in the same herd

Platform superadmin: FOR ALL bypass where defined.

On this page