STORY
Creates the story table
Primary Key
| Primary Key | Field Type |
|---|---|
| ID | uniqueidentifier |
Fields
| Field | Field Type | Null | Notes | Description |
|---|---|---|---|---|
| STORYTEXT | nvarchar(4000) | Default = '' | ||
| FAFIMAGESID | uniqueidentifier | yes | The image associated with this story | |
| IMAGECODE | tinyint | Default = 0 | Image Type | |
| IMAGE | nvarchar(5) (Computed) | yes | CASE [IMAGECODE] WHEN 0 THEN N'Image' WHEN 1 THEN N'Video' END | Provides a translation for the 'IMAGECODE' field. |
| 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. |
| TYPECODE | tinyint | Default = 0 | Type | |
| TYPE | nvarchar(11) (Computed) | yes | CASE [TYPECODE] WHEN 0 THEN N'Participant' WHEN 1 THEN N'Team' WHEN 2 THEN N'Company' WHEN 3 THEN N'Household' END | Provides a translation for the 'TYPECODE' field. |
Foreign Keys
| Foreign Key | Field Type | Null | Notes | Description |
|---|---|---|---|---|
| EVENTID | uniqueidentifier | yes | EVENT.ID | The event id related to this story |
| ADDEDBYID | uniqueidentifier | CHANGEAGENT.ID | FK to CHANGEAGENT. | |
| CHANGEDBYID | uniqueidentifier | CHANGEAGENT.ID | FK to CHANGEAGENT. | |
| REGISTRANTID | uniqueidentifier | yes | REGISTRANT.ID | The registrant id related to this story |
| TEAMFUNDRAISINGTEAMID | uniqueidentifier | yes | TEAMFUNDRAISINGTEAM.ID | The Team id related to this story |
Indexes
| Index Name | Fields | Unique | Primary | Clustered |
|---|---|---|---|---|
| IX_STORY_DATEADDED | DATEADDED | yes | ||
| IX_STORY_DATECHANGED | DATECHANGED | |||
| IX_STORY_EVENTID_TEAMFUNDRAISINGTEAMID | EVENTID, TEAMFUNDRAISINGTEAMID | |||
| IX_STORY_REGISTRANTID | REGISTRANTID | |||
| PK_STORY | ID | yes | yes |
Triggers
| Trigger Name | Description |
|---|---|
| TR_STORY_AUDIT_UPDATE | |
| TR_STORY_AUDIT_DELETE |