CREDITITEMMEMBERSHIP

Stores membership transaction information for a credit item.

Primary Key

Primary Key Field Type
ID uniqueidentifier

Fields

Field Field Type Null Notes Description
MEMBERSHIPPROGRAMNAME nvarchar(100) Default = '' Name of membership program at time of refund.
NUMBEROFCHILDREN smallint Default = ((0)) The number of children allowed on this membership.
COMMENTS nvarchar(1000) Default = '' Remarks about this membership.
ISGIFT bit Default = 0 Denotes that this membership is a gift.
EXPIRATIONDATE datetime yes The expiration date of this membership.
ACTIONCODE tinyint Default = 0 The action of this transaction on the membership.
ACTION nvarchar(9) (Computed) yes CASE [ACTIONCODE] WHEN 0 THEN N'Join' WHEN 1 THEN N'Renew' WHEN 2 THEN N'Upgrade' WHEN 3 THEN N'Downgrade' WHEN 4 THEN N'Drop' WHEN 5 THEN N'Rejoin' END Provides a translation for the 'ACTIONCODE' field.
MEMBERS xml yes List of members at time of refund.
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.
WILLBECANCELLED bit Default = 1

Foreign Keys

Foreign Key Field Type Null Notes Description
ID uniqueidentifier FINANCIALTRANSACTIONLINEITEM.ID Primary Key.
MEMBERSHIPID uniqueidentifier yes MEMBERSHIP.ID The membership ID.
MEMBERSHIPPROGRAMID uniqueidentifier MEMBERSHIPPROGRAM.ID The membership program of this record.
MEMBERSHIPLEVELID uniqueidentifier MEMBERSHIPLEVEL.ID The membership level of this record.
MEMBERSHIPLEVELTERMID uniqueidentifier MEMBERSHIPLEVELTERM.ID The membership level term of this record.
MEMBERSHIPLEVELTYPECODEID uniqueidentifier yes MEMBERSHIPLEVELTYPECODE.ID The type of membership.
GIVENBYID uniqueidentifier yes CONSTITUENT.LOCALID The constituent that is responsible for giving the membership as a gift.
ADDEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
CHANGEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.

Indexes

Index Name Fields Unique Primary Clustered
IX_CREDITITEMMEMBERSHIP_DATEADDED DATEADDED yes
IX_CREDITITEMMEMBERSHIP_DATECHANGED DATECHANGED
IX_CREDITITEMMEMBERSHIP_GIVENBYID GIVENBYID
PK_CREDITITEMMEMBERSHIP ID yes yes

Triggers

Trigger Name Description
TR_CREDITITEMMEMBERSHIP_AUDIT_UPDATE
TR_CREDITITEMMEMBERSHIP_AUDIT_DELETE