REVENUELIFECYCLE

Keeps track of the constituent's donor lifecycle value.

Primary Key

Primary Key Field Type
ID uniqueidentifier

Fields

Field Field Type Null Notes Description
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.
DONORSTATECODE tinyint Default = 7 0=New, 1=Recapture, 2=Upgrade, 3=Same, 4=Downgrade, 5=Lapsed new donor, 6=Lapsed repeat donor, 7=Lapsed multiple years, 8=Non-donor
LASTREVENUEDATE date yes Date of the last revenue transaction made by the constituent.
STARTDATE datetime
DONORSTATE nvarchar(21) (Computed) yes CASE [DONORSTATECODE] WHEN 0 THEN N'New' WHEN 1 THEN N'Recapture' WHEN 2 THEN N'Upgrade' WHEN 3 THEN N'Same' WHEN 4 THEN N'Downgrade' WHEN 5 THEN N'Lapsed new donor' WHEN 6 THEN N'Lapsed repeat donor' WHEN 7 THEN N'Lapsed multiple years' WHEN 8 THEN N'Non-donor' END Provides a translation for the 'DONORSTATECODE' field.
FIRSTREVENUEDATE date yes Date of the last revenue transaction made by the constituent.

Foreign Keys

Foreign Key Field Type Null Notes Description
CONSTITUENTID uniqueidentifier CONSTITUENT.LOCALID FK to CONSTITUENT
LIFECYCLETYPEID uniqueidentifier LIFECYCLETYPE.ID FK to LIFECYCLETYPE
ADDEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
CHANGEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.

Indexes

Index Name Fields Unique Primary Clustered
IX_REVENUELIFECYCLE_DATEADDED DATEADDED yes
IX_REVENUELIFECYCLE_DATECHANGED DATECHANGED
IX_REVENUELIFECYCLE_LIFECYCLETYPEID LIFECYCLETYPEID
PK_REVENUELIFECYCLE ID yes yes
UIX_REVENUELIFECYCLE_CONSTITUENTID_LIFECYCLETYPEID CONSTITUENTID, LIFECYCLETYPEID yes

Triggers

Trigger Name Description
TR_REVENUELIFECYCLE_UPDATE
TR_REVENUELIFECYCLE_DELETE
TR_REVENUELIFECYCLE_AUDIT_UPDATE
TR_REVENUELIFECYCLE_AUDIT_DELETE