PROGRAMSTAFFRESOURCE

Contains the resources and quantity of those staff resources needed for a program.

Primary Key

Primary Key Field Type
ID uniqueidentifier

Fields

Field Field Type Null Notes Description
QUANTITYNEEDED int Default = 0 The quantity of the resource needed for the event.
FILLEDBYCODE tinyint Default = 0 The type of staffing resource which can be used to fulfill this requirement.
DATEADDED datetime Default = getdate() Indicates the date this record was added.
DATECHANGED datetime Default = getdate() Indicates the date this record was last changed.
TS timestamp Timestamp.
TSLONG bigint (Computed) yes CONVERT(bigint, TS) Numeric representation of the timestamp.
FILLEDBY nvarchar(9) (Computed) yes CASE [FILLEDBYCODE] WHEN 0 THEN N'Volunteer' WHEN 1 THEN N'Staff' WHEN 2 THEN N'Board' END Provides a translation for the 'FILLEDBYCODE' field.

Foreign Keys

Foreign Key Field Type Null Notes Description
PROGRAMID uniqueidentifier PROGRAM.ID The program that this resource is added to.
VOLUNTEERTYPEID uniqueidentifier VOLUNTEERTYPE.LOCALID The staff resource that we are adding to the program.
JOBID uniqueidentifier yes JOB.ID The job associated with the program staff resource.
ADDEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
CHANGEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.

Indexes

Index Name Fields Unique Primary Clustered
IX_PROGRAMSTAFFRESOURCE_DATEADDED DATEADDED yes
IX_PROGRAMSTAFFRESOURCE_DATECHANGED DATECHANGED
PK_PROGRAMSTAFFRESOURCE ID yes yes
UIX_PROGRAMSTAFFRESOURCE_PROGRAMID_VOLUNTEERTYPEID PROGRAMID, VOLUNTEERTYPEID yes

Triggers

Trigger Name Description
TR_PROGRAMSTAFFRESOURCE_AUDIT_UPDATE
TR_PROGRAMSTAFFRESOURCE_AUDIT_DELETE
TR_PROGRAMSTAFFRESOURCE_INSERT_JOB
TR_PROGRAMSTAFFRESOURCE_DELETE_JOB