Skip to content

app.shifts

TableRow level security on

Crew shifts: one person (or an open slot) in one role for one block of time on a project. A shift cannot end before it starts (invariant 20).

Primary key: id

Columns of app.shifts
ColumnTypeNullableDescription
iduuidNoPrimary key, UUID v7.
org_iduuidNoOwning org, derived from app.projects on insert; never accepted from the caller and never changed.References app.organizations.id
project_iduuidNoProject the shift works on.References app.projects.id
record_iduuidYesShift record of the same project the shift staffs, when planned through one.References app.records.id
scope_node_iduuidYesScope node of the same project, such as the show.References app.scope_nodes.id
membership_iduuidYesMembership of the assigned person; NULL for an open shift.References app.memberships.id
role_codetextYesCanon role worked (Roles Library).References xpms.role.role_code
starts_attimestamp with time zoneNoCall time.
ends_attimestamp with time zoneNoEnd of the shift; after starts_at.
time_zonetextNoIANA zone the shift times were typed in.
deleted_attimestamp with time zoneYesSoft delete time. A row with deleted_at set is ignored by every access helper.
created_attimestamp with time zoneNoWhen the row was inserted. Set by the database.
created_byuuidYesPerson who inserted the row, or null for a platform process. Set by the database.References app.people.id
updated_attimestamp with time zoneNoWhen the row last changed. Set by the database.
updated_byuuidYesPerson who last changed the row, or null for a platform process. Set by the database.References app.people.id
shift_stateapp.shift_stateNoShift state. Changes only through app.transition_shift, app.publish_shifts, app.accept_shift and app.claim_open_shift.
engagement_iduuidYesEngagement of the external person assigned, when the shift is worked by someone without a membership. At most one of membership_id and engagement_id; neither is an open shift.References app.engagements.id
scheduled_break_minutesintegerYesMeal break scheduled within the shift, in minutes.