Administrator access

Enter the site-wide access code to view pgfacts.org.

Simple gate for now; not a full login system.
Contact Us
Work In Progress: database/schema.md Complete SQL Server table definitions, constraints, sample data, and database object purposes.

Database Schema

The documentation site describes the schema for the AllThingsPG database in SQL Server. AllThingsDB is a relational database that contains both data and business logic and will be used by the Phase 2 version of www.allthingspg.org. Refer to a link for a discusson on Databases.

The schema for the database is created, maintained and deployed by a SSDT project in VS 2022 called AllThingsPG.Database contained in GitHub, and is considered the master source of all schema The database will be developed and tested on a local SQL Server, and when ready, will be deployed to a staging environment in Azure to a Azure SQL database. Refer to Builds and Deployments for more information.

The VS2022 database project defines all implemented schema including tables, views, constraints, stored procedures, functions and other objects. The database is built and deployed from that source, and can either deploy to local development or Azure SQLh in staging.

Database project inventory

Object typeCountWhat is listed here
Tables3634 of the 36 project tables are documented here; two legacy or supporting tables are omitted. The remaining table sections include columns, declared constraints, foreign keys, and sample data.
Views12Purpose only.
Functions15Purpose only.
Stored procedures75Purpose only.

Sample data shows project seed values or rows available in the supplied extract. Where no sample rows are available, the page says NO DATA AVAILABLE. A section with fewer than five available records shows all available records rather than invented rows. Two legacy or supporting tables are omitted from this reference.

Table List with Classifications

TablenameTableTypePurpose
SystemTablesSystemLists database tables with their catalog category and order.
SystemSettingsSystemStores application and database settings.
NumbersSystemStores integers from 1 through 1,000 for utility use.
ErrorLogSystemRecords database messages and errors.
RouteTypeLookupNames the kinds of menu destinations.
VisitorTypeLookupDefines visitor audiences.
ContentTypeLookupClassifies content documents.
FormatTypeLookupDefines content block formats and file extensions.
MimeTypeLookupDefines media types and rendering characteristics.
WorkflowStatusLookupDefines content workflow states.
MasterMenuMenuHolds the imported source menu.
MasterMenuStageMenuStages imported menu rows for processing.
MenuItemTestHarnessMenuStores menu test cases and their validation results.
TestHarnessMenuStores menu test cases and results.
MenuItemMenuHolds the website's navigation items and route targets.
PortalMenuMenuHolds visitor-specific portal tiles.
BoardMemberMenuHolds board member names, roles, biographies, and images.
ContentDocumentContentHolds a page's content description and publication state.
ContentElementContentHolds text, media, or file content blocks.
StagingDocumentStagingHolds a content document being prepared.
StagingElementStagingHolds content blocks being prepared.
RegistrationRegistrationHolds a person's email, visitor type, and participation choices.
ContactRegistrationHolds contact and address details for a registration.
NewsletterRegistrationConnects a newsletter to its content and dates.
EmailRegistrationHolds an email subject, body, and sent date.
EmailRecipientRegistrationConnects an email to a registered recipient.
EmailAttachmentRegistrationHolds a file attached to an email.
EmailRequestRegistrationHolds an outbound email request for processing.
MigrationDocumentMigrationStores legacy page metadata captured for migration.
MigrationElementMigrationStores legacy page content blocks captured for migration.
MigrationMappingMigrationMaps legacy page titles to current menu items.

Tables

SystemTables

Complete list of the 31 tables classified by the project seed routine.

Implemented columns

ColumnSQL definition
TableIDINT IDENTITY (1, 1) NOT NULL
TableNameVARCHAR (50) NOT NULL
TableTypeVARCHAR (15) NOT NULL
SortOrderINT NOT NULL

Constraints and foreign keys

NameDefinition
Unnamed PRIMARY KEYPRIMARY KEY CLUSTERED ([TableID] ASC)
CK_SystemTables_TableTypeCONSTRAINT [CK_SystemTables_TableType] CHECK ([TableType]='Migration' OR [TableType]='Registration' OR [TableType]='Menu' OR [TableType]='Staging' OR [TableType]='Content' OR [TableType]='Lookup' OR [TableType]='System')
UQ_SystemTables_TableNameCONSTRAINT [UQ_SystemTables_TableName] UNIQUE NONCLUSTERED ([TableName] ASC)

Sample Data

TableNameTableTypeSortOrder
SystemTablesSystem11
SystemSettingsSystem12
NumbersSystem13
ErrorLogSystem14
RouteTypeLookup21
VisitorTypeLookup22
ContentTypeLookup23
FormatTypeLookup24
MimeTypeLookup25
WorkflowStatusLookup26
MasterMenuMenu30
MasterMenuStageMenu31
MenuItemTestHarnessMenu32
TestHarnessMenu33
MenuItemMenu34
PortalMenuMenu35
BoardMemberMenu36
ContentDocumentContent41
ContentElementContent42
StagingDocumentStaging51
StagingElementStaging52
RegistrationRegistration61
ContactRegistration62
NewsletterRegistration63
EmailRegistration64
EmailRecipientRegistration65
EmailAttachmentRegistration66
EmailRequestRegistration67
MigrationDocumentMigration70
MigrationElementMigration71
MigrationMappingMigration72

SystemSettings

Stores typed settings such as site configuration, menu source, and feature choices. These rows are from the database project’s baseline settings.

Implemented columns

ColumnSQL definition
SettingIDINT IDENTITY (1, 1) NOT NULL
SettingKeyVARCHAR (50) NOT NULL
SettingTypeVARCHAR (50) NOT NULL
SettingGroupVARCHAR (50) NOT NULL
SettingValueSQL_VARIANT NULL
LastUpdatedDATETIME2 (7) CONSTRAINT [DF_SystemSettings_LastUpdated] DEFAULT (sysdatetime()) NOT NULL

Constraints and foreign keys

NameDefinition
DF_SystemSettings_LastUpdatedCONSTRAINT [DF_SystemSettings_LastUpdated] DEFAULT (sysdatetime()) NOT NULL
PK_SystemSettingsCONSTRAINT [PK_SystemSettings] PRIMARY KEY CLUSTERED ([SettingID] ASC)
CK_SystemSettings_GroupUpperCONSTRAINT [CK_SystemSettings_GroupUpper] CHECK (([SettingGroup]) collate Latin1_General_CS_AS=(upper([SettingGroup])) collate Latin1_General_CS_AS)
CK_SystemSettings_GUID_ValidCONSTRAINT [CK_SystemSettings_GUID_Valid] CHECK ([SettingType]<>'GUID' OR TRY_CAST([SettingValue] AS [uniqueidentifier]) IS NOT NULL)
CK_SystemSettings_JSON_ValidCONSTRAINT [CK_SystemSettings_JSON_Valid] CHECK ([SettingType]<>'JSON' OR isjson(CONVERT([nvarchar](max),[SettingValue]))=(1))
CK_SystemSettings_KeyUpperCONSTRAINT [CK_SystemSettings_KeyUpper] CHECK (([SettingKey]) collate Latin1_General_CS_AS=(upper([SettingKey])) collate Latin1_General_CS_AS)
CK_SystemSettings_SettingGroupCONSTRAINT [CK_SystemSettings_SettingGroup] CHECK ([SettingGroup]='GLOBALVAR' OR [SettingGroup]='APPLICATION' OR [SettingGroup]='DATABASE' OR [SettingGroup]='SYSTEM')
CK_SystemSettings_SettingTypeCONSTRAINT [CK_SystemSettings_SettingType] CHECK ([SettingType]='LIST' OR [SettingType]='JSON' OR [SettingType]='GUID' OR [SettingType]='DATETIME' OR [SettingType]='DATE' OR [SettingType]='MONEY' OR [SettingType]='DECIMAL' OR [SettingType]='INTEGER' OR [SettingType]='STRING' OR [SettingType]='BOOLEAN' OR [SettingType]='BINARY')
CK_SystemSettings_TypeUpperCONSTRAINT [CK_SystemSettings_TypeUpper] CHECK (([SettingType]) collate Latin1_General_CS_AS=(upper([SettingType])) collate Latin1_General_CS_AS)
CK_SystemSettings_Value_NotNullCONSTRAINT [CK_SystemSettings_Value_NotNull] CHECK (([SettingType]='JSON' OR [SettingType]='GUID' OR [SettingType]='DATETIME' OR [SettingType]='DATE' OR [SettingType]='MONEY' OR [SettingType]='DECIMAL' OR [SettingType]='INTEGER' OR [SettingType]='BOOLEAN' OR [SettingType]='BINARY') AND [SettingValue] IS NOT NULL OR ([SettingType]='LIST' OR [SettingType]='STRING'))
UQ_SystemSettings_KeyCONSTRAINT [UQ_SystemSettings_Key] UNIQUE NONCLUSTERED ([SettingKey] ASC)

Sample Data

SettingKeySettingTypeSettingGroupSettingValue
SITE_NAMESTRINGSYSTEMAllThingsPG
MASTER_MENUSTRINGSYSTEMC:\ATPG\Master_Menu.csv
ENABLE_REGISTRATIONBOOLEANAPPLICATIONTRUE
DEFAULT_PAGE_SIZEINTEGERGLOBALVAR25
SUPPORT_EMAILSTRINGGLOBALVARsupport@allthingspg.org

Numbers

Contains the integers 1 through 1,000.

Implemented columns

ColumnSQL definition
NumberINT NOT NULL

Constraints and foreign keys

NameDefinition
Unnamed PRIMARY KEYPRIMARY KEY CLUSTERED ([Number] ASC)

Sample Data

Number
1
2
3
4
5

ErrorLog

Records routine name, message, severity, parameters, and execution context. The following ten rows illustrate possible log entries; they are not captured incidents.

Implemented columns

ColumnSQL definition
ErrorLogIDINT IDENTITY (1, 1) NOT NULL
ProcedureName[sysname] NOT NULL
ErrorMessageNVARCHAR (4000) NULL
ErrorNumberINT NULL
ErrorSeverityINT NULL
ErrorStateINT NULL
ParametersNVARCHAR (MAX) NULL
UserNameNVARCHAR (128) DEFAULT (suser_sname()) NOT NULL
HostNameNVARCHAR (128) DEFAULT (host_name()) NOT NULL
LogLevelVARCHAR (10) DEFAULT ('ERROR') NOT NULL
LogDateDATETIME2 (7) DEFAULT (sysdatetime()) NOT NULL

Constraints and foreign keys

NameDefinition
Unnamed PRIMARY KEYPRIMARY KEY CLUSTERED ([ErrorLogID] ASC)
CK_ErrorLog_LogLevelCONSTRAINT [CK_ErrorLog_LogLevel] CHECK ([LogLevel]='DEBUG' OR [LogLevel]='INFO' OR [LogLevel]='WARNING' OR [LogLevel]='ERROR')

Sample Data

ProcedureNameErrorMessageLogLevelLogDate
Populate_MenuItemsMenu validation failed: route target is missing.ERRORExample timestamp
Insert_MenuItemRoute type is not recognized.ERRORExample timestamp
Insert_ContentDocumentContent type is not recognized.ERRORExample timestamp
Insert_ContentElementContent document was not found.ERRORExample timestamp
Perform_MenuItem_ValidationVisitor mask contains an unsupported code.WARNINGExample timestamp
Populate_MasterMenuRequired source file could not be opened.ERRORExample timestamp
Populate_TestHarnessTest case has no expected result.WARNINGExample timestamp
Publish_StagingStaged menu item could not be published.ERRORExample timestamp
Get_SystemSettingRequested setting key was not found.WARNINGExample timestamp
Initialize_DatabaseInitialization completed with a logged diagnostic.INFOExample timestamp

Lookup tables

RouteType

Identifies how a menu item is opened. All current seed values:

Implemented columns

ColumnSQL definition
CodeCHAR (1) NOT NULL
DescriptionNVARCHAR (200) NOT NULL
FolderNVARCHAR (200) NOT NULL
SortOrderINT NOT NULL

Constraints and foreign keys

NameDefinition
PK_RouteTypeCONSTRAINT [PK_RouteType] PRIMARY KEY CLUSTERED ([Code] ASC)

Sample Data

CodeDescriptionFolderSortOrder
VVisitorVisitor1
CContentContent2
PPagePage3
RRedirectRedirect4

VisitorType

Defines the visitor types available to the site. All current seed values:

Implemented columns

ColumnSQL definition
CodeCHAR (1) NOT NULL
DescriptionNVARCHAR (200) NOT NULL
SortOrderINT NOT NULL
IsDefaultBIT NOT NULL

Constraints and foreign keys

NameDefinition
PK_VisitorTypeCONSTRAINT [PK_VisitorType] PRIMARY KEY CLUSTERED ([Code] ASC)

Sample Data

CodeDescriptionSortOrderIsDefault
PPatient10
CCaregiver20
MProvider30
DPharmaceutical40
VGuest51

ContentType

Classifies a content document. All current seed values:

Implemented columns

ColumnSQL definition
CodeCHAR (1) NOT NULL
NameNVARCHAR (50) NOT NULL
DescriptionNVARCHAR (200) NOT NULL
SortOrderINT NOT NULL

Constraints and foreign keys

NameDefinition
PK_ContentTypeCONSTRAINT [PK_ContentType] PRIMARY KEY CLUSTERED ([Code] ASC)

Sample Data

CodeNameDescriptionSortOrder
AArticleLong-form educational content1
NNewsItemNews updates and announcements2
FFAQQuestion and answer pairs3
TTestimonialPatient and caregiver stories4
PProfileBoard members, staff, medical experts5
EEventEvents, webinars, fundraisers6
LLinkExternal resource or reference8
RResearchClinical trial or research study9
XExternalExternal file10
GGalleryImage gallery metadata11
DDocumentPDF or downloadable file reference12
UUnknownContent has not been populated99

FormatType

Defines a content block’s format and associated file extensions. All current seed values:

Implemented columns

ColumnSQL definition
CodeCHAR (1) NOT NULL
NameNVARCHAR (50) NOT NULL
DescriptionNVARCHAR (200) NOT NULL
FileTypesNVARCHAR (200) NOT NULL
SortOrderINT NOT NULL

Constraints and foreign keys

NameDefinition
PK_FormatTypeCONSTRAINT [PK_FormatType] PRIMARY KEY CLUSTERED ([Code] ASC)

Sample Data

CodeNameDescriptionFileTypes
TTextPlain Text.txt
RRTFRich Text.rtf
HHTMLWeb Page Markup.html, .htm
EEPUBElectronic Pub.epub
PPDFPortable Doc.pdf
MMDMarkdown.md
JJSONJSON.json
IIMAGEBinary Image.gif, .jpg, .svg, .webp, .png
AAUDIOBinary Audio.mp3, .wav, .ogg
WWORDMS Word Document.docx, .docm, .dotx, .dotm
SEXCELMS Spreadsheet.xls, .xlsx
NPPTPowerpoint.ppt, .pptx, .pps, .ppsx, .pot, .potx, .pptm, .ppsm, .potm
GGDOCGoogle Document.gdoc
DOPENOpen Document.odt
?UNKNOWNUnknown.bin

MimeType

Identifies the media type and whether content is text, binary, or renderable. All current seed values:

Implemented columns

ColumnSQL definition
CodeCHAR (1) NOT NULL
FormatTypeCHAR (1) NOT NULL
NameNVARCHAR (50) NOT NULL
DescriptionNVARCHAR (200) NOT NULL
IsTextBIT NOT NULL
IsBinaryBIT NOT NULL
IsRenderableBIT NOT NULL
SortOrderINT NOT NULL

Constraints and foreign keys

NameDefinition
PK_MimeTypeCONSTRAINT [PK_MimeType] PRIMARY KEY CLUSTERED ([Code] ASC)
FK_MimeType_FormatTypeCONSTRAINT [FK_MimeType_FormatType] FOREIGN KEY ([FormatType]) REFERENCES [dbo].[FormatType] ([Code])

Sample Data

CodeFormatTypeNameDescriptionTextBinaryRenderable
TTTXTtext/plain101
MMMDtext/markdown101
HHHTMLtext/html101
CHHTMtext/htm101
RRRTFapplication/rtf100
JJJSONapplication/json100
EEEPUBapplication/epub+zip010
PPPDFapplication/pdf011
IIJPGimage/jpeg011
NIPNGimage/png011
FIGIFimage/gif011
SISVGimage/svg+xml101
WIWEBPimage/webp011
AAMP3audio/mpeg011
UAWAVaudio/wav011
QAOGGaudio/ogg011
DWDOCXapplication/vnd.openxmlformats-officedocument.wordprocessingml.document010
XWDOCMapplication/vnd.ms-word.document.macroEnabled.12010
YWDOTXapplication/vnd.openxmlformats-officedocument.wordprocessingml.template010
ZWDOTMapplication/vnd.ms-word.template.macroEnabled.12010
LSXLSapplication/vnd.ms-excel010
KSXLSXapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheet010
!NPPTapplication/vnd.ms-powerpoint010
@NPPTXapplication/vnd.openxmlformats-officedocument.presentationml.presentation010
#NPPSapplication/vnd.ms-powerpoint010
$NPPSXapplication/vnd.openxmlformats-officedocument.presentationml.slideshow010
%NPOTapplication/vnd.ms-powerpoint010
^NPOTXapplication/vnd.openxmlformats-officedocument.presentationml.template010
&NPPTMapplication/vnd.ms-powerpoint.presentation.macroEnabled.12010
*NPPSMapplication/vnd.ms-powerpoint.slideshow.macroEnabled.12010
+NPOTMapplication/vnd.ms-powerpoint.template.macroEnabled.12010
GGGDOCapplication/vnd.google-apps.document010
ODODTapplication/vnd.oasis.opendocument.text010
B?BINapplication/octet-stream010

WorkflowStatus

Defines the content workflow stage. All current seed values:

Implemented columns

ColumnSQL definition
CodeCHAR (1) NOT NULL
TitleNVARCHAR (50) NOT NULL
DescriptionNVARCHAR (200) NULL
SortOrderINT NOT NULL

Constraints and foreign keys

NameDefinition
PK_WorkflowStatusCONSTRAINT [PK_WorkflowStatus] PRIMARY KEY CLUSTERED ([Code] ASC)

Sample Data

CodeTitleDescriptionSortOrder
DDraftContent is newly curated or created1
RReviewContent needs review2
AApprovedContent has been approved but not published3
XRejectedContent has been rejected4
PPublishedContent has been published5
SStagingContent is linked to a staged menu item6

MasterMenu

Imported source menu entries, including hierarchy labels, route, audience, description, and notes.

Implemented columns

ColumnSQL definition
MenuIDINT IDENTITY (1, 1) NOT NULL
ParentMenuIDINT NULL
MenuItemIDINT NULL
ContentDocumentIDINT NULL
ParentNVARCHAR (100) NOT NULL
ChildNVARCHAR (100) NOT NULL
SubMenuNVARCHAR (100) NOT NULL
MenuTypeCHAR (1) NOT NULL
TitleNVARCHAR (200) NULL
VisitorMaskNVARCHAR (20) NULL
RouteTypeNVARCHAR (10) NULL
RouteTargetNVARCHAR (200) NULL
DescriptionNVARCHAR (200) NOT NULL
NotesNVARCHAR (200) NULL

Constraints and foreign keys

NameDefinition
PK_MasterMenuCONSTRAINT [PK_MasterMenu] PRIMARY KEY CLUSTERED ([MenuID] ASC)
UQ_MasterMenuCONSTRAINT [UQ_MasterMenu] UNIQUE NONCLUSTERED ([Title] ASC, [RouteType] ASC, [VisitorMask] ASC)

Sample Data

Sample status
NO DATA AVAILABLE

TestHarness

Stores menu validation cases and their expected/actual results.

Implemented columns

ColumnSQL definition
TestHarnessIDINT IDENTITY (1, 1) NOT NULL
TestIDINT NOT NULL
ParentTestIDINT NULL
CategoryVARCHAR (50) NULL
MenuTypeCHAR (1) NULL
DescriptionNVARCHAR (300) NULL
NotesNVARCHAR (300) NULL
TitleNVARCHAR (200) NULL
RouteTypeCHAR (1) NULL
RouteTargetNVARCHAR (200) NULL
VisitorMaskVARCHAR (10) NULL
SortOrderINT NULL
IsActiveBIT NULL
IsProcessedBIT NULL
ExpectedVARCHAR (10) NULL
ActualVARCHAR (10) NULL
IsErrorBIT NULL
ErrorNumberINT NULL
ErrorMessageNVARCHAR (500) NULL
MenuItemIDINT NULL
ContentDocumentIDINT NULL

No constraints are declared in this table definition.

Sample Data

Sample status
NO DATA AVAILABLE

The navigation records used by the site. For content routes, RouteTarget contains the associated ContentDocumentID. The examples below are grouped by route type and come from the supplied menu extract.

Implemented columns

ColumnSQL definition
MenuItemIDINT IDENTITY (1, 1) NOT NULL
ParentMenuItemIDINT NULL
TitleNVARCHAR (200) NOT NULL
RouteTypeCHAR (1) NOT NULL
RouteTargetNVARCHAR (200) NOT NULL
VisitorMaskVARCHAR (10) NOT NULL
SortOrderINT CONSTRAINT [DF_MenuItem_SortOrder] DEFAULT ((0)) NOT NULL
IsActiveBIT CONSTRAINT [DF_MenuItem_IsActive] DEFAULT ((1)) NOT NULL
CreatedDateDATETIME2 (0) CONSTRAINT [DF_MenuItem_CreatedDate] DEFAULT (sysdatetime()) NOT NULL
ModifiedDateDATETIME2 (0) CONSTRAINT [DF_MenuItem_ModifiedDate] DEFAULT (sysdatetime()) NOT NULL

Constraints and foreign keys

NameDefinition
DF_MenuItem_SortOrderCONSTRAINT [DF_MenuItem_SortOrder] DEFAULT ((0)) NOT NULL
DF_MenuItem_IsActiveCONSTRAINT [DF_MenuItem_IsActive] DEFAULT ((1)) NOT NULL
DF_MenuItem_CreatedDateCONSTRAINT [DF_MenuItem_CreatedDate] DEFAULT (sysdatetime()) NOT NULL
DF_MenuItem_ModifiedDateCONSTRAINT [DF_MenuItem_ModifiedDate] DEFAULT (sysdatetime()) NOT NULL
PK_MenuItemCONSTRAINT [PK_MenuItem] PRIMARY KEY CLUSTERED ([MenuItemID] ASC)
UQ_MenuItem_Title_RouteType_VisitorMaskCONSTRAINT [UQ_MenuItem_Title_RouteType_VisitorMask] UNIQUE NONCLUSTERED ([Title] ASC, [RouteType] ASC, [VisitorMask] ASC)
CK_MenuItem_SortOrderCONSTRAINT [CK_MenuItem_SortOrder] CHECK ([SortOrder]>=(0))
CK_MenuItem_Title_NormalizedCONSTRAINT [CK_MenuItem_Title_Normalized] CHECK (NOT [Title] like '%[%?=&#:/\<>]%')
CK_MenuItem_VisitorMaskCONSTRAINT [CK_MenuItem_VisitorMask] CHECK (NOT [VisitorMask] like '%[^PCMDVR]%' AND len([VisitorMask])>(0))
FK_MenuItem_ParentCONSTRAINT [FK_MenuItem_Parent] FOREIGN KEY ([ParentMenuItemID]) REFERENCES [dbo].[MenuItem] ([MenuItemID])
FK_MenuItem_RouteTypeCONSTRAINT [FK_MenuItem_RouteType] FOREIGN KEY ([RouteType]) REFERENCES [dbo].[RouteType] ([Code])

Visitor routes (V)

Sample Data

MenuItemIDParentMenuItemIDTitleRouteTargetVisitorMask
1NULLWelcome/visitor?target=GuestPCMDV
21Patient/visitor?target=PatientPCMDV

Content routes (C)

Sample Data

MenuItemIDTitleRouteTargetVisitorMaskContentDocumentIDIsPublished
8About PG/content?target=1PCMDV10
9What is PG/content?target=2PCMDV20
18Emotional Journey/content?target=11PCMDV110
25Emotional Journey/content?target=18P180
32Emotional Journey/content?target=25C250
38Being a Provider/content?target=31M310
39Early Diagnosis/content?target=32M320

Page routes (P)

Sample Data

MenuItemIDTitleRouteTargetVisitorMask
72Clinic Finder/page?target=clinicfinder.cshtmlPCMDV

Redirect routes (R)

Sample Data

MenuItemIDTitleRouteTargetVisitorMask
74All Things Pyoderma 4.2k members/redirect?target=https://www.facebook.com/groups/368163159232PCMDV

The repeated Emotional Journey title represents general, patient, and caregiver pages with separate menu and content IDs. The content rows shown are unpublished placeholders, not authored articles.

PortalMenu

Stores tiles shown for individual visitor types: title, short description, icon path, and linked menu item.

Implemented columns

ColumnSQL definition
PortalMenuIDINT IDENTITY (1, 1) NOT NULL
MenuItemIDINT NOT NULL
TitleNVARCHAR (200) NOT NULL
DescriptionNVARCHAR (200) NOT NULL
IconPathNVARCHAR (200) NOT NULL
VisitorTypeCHAR (1) NOT NULL
CreatedDateDATETIME2 (0) CONSTRAINT [DF_PortalMenu_CreatedDate] DEFAULT (sysdatetime()) NOT NULL
ModifiedDateDATETIME2 (0) CONSTRAINT [DF_PortalMenu_ModifiedDate] DEFAULT (sysdatetime()) NOT NULL

Constraints and foreign keys

NameDefinition
DF_PortalMenu_CreatedDateCONSTRAINT [DF_PortalMenu_CreatedDate] DEFAULT (sysdatetime()) NOT NULL
DF_PortalMenu_ModifiedDateCONSTRAINT [DF_PortalMenu_ModifiedDate] DEFAULT (sysdatetime()) NOT NULL
PK_PortalMenuCONSTRAINT [PK_PortalMenu] PRIMARY KEY CLUSTERED ([PortalMenuID] ASC)
FK_PortalMenu_MenuItemCONSTRAINT [FK_PortalMenu_MenuItem] FOREIGN KEY ([MenuItemID]) REFERENCES [dbo].[MenuItem] ([MenuItemID])
FK_PortalMenu_VisitorTypeCONSTRAINT [FK_PortalMenu_VisitorType] FOREIGN KEY ([VisitorType]) REFERENCES [dbo].[VisitorType] ([Code])

Sample Data

Sample status
NO DATA AVAILABLE

BoardMember

Stores board member names, roles, positions, descriptions, photos, and display order. These names and roles come from the database seed procedure.

Implemented columns

ColumnSQL definition
BoardMemberIDINT IDENTITY (1, 1) NOT NULL
NameNVARCHAR (200) NOT NULL
RoleNVARCHAR (200) NULL
PositionNVARCHAR (200) NULL
DescriptionNVARCHAR (MAX) NULL
PictureFileNameVARCHAR (255) NULL
PictureFileTypeVARCHAR (50) NULL
PictureDataVARBINARY (MAX) NULL
SortOrderINT CONSTRAINT [DF_BoardMember_SortOrder] DEFAULT ((0)) NOT NULL
IsActiveBIT CONSTRAINT [DF_BoardMember_IsActive] DEFAULT ((1)) NOT NULL
CreatedDateDATETIME2 (0) CONSTRAINT [DF_BoardMember_CreatedDate] DEFAULT (sysdatetime()) NOT NULL
ModifiedDateDATETIME2 (0) CONSTRAINT [DF_BoardMember_ModifiedDate] DEFAULT (sysdatetime()) NOT NULL

Constraints and foreign keys

NameDefinition
DF_BoardMember_SortOrderCONSTRAINT [DF_BoardMember_SortOrder] DEFAULT ((0)) NOT NULL
DF_BoardMember_IsActiveCONSTRAINT [DF_BoardMember_IsActive] DEFAULT ((1)) NOT NULL
DF_BoardMember_CreatedDateCONSTRAINT [DF_BoardMember_CreatedDate] DEFAULT (sysdatetime()) NOT NULL
DF_BoardMember_ModifiedDateCONSTRAINT [DF_BoardMember_ModifiedDate] DEFAULT (sysdatetime()) NOT NULL
PK_BoardMemberCONSTRAINT [PK_BoardMember] PRIMARY KEY CLUSTERED ([BoardMemberID] ASC)
CK_BoardMember_SortOrderCONSTRAINT [CK_BoardMember_SortOrder] CHECK ([SortOrder]>=(0))

Sample Data

NameRolePositionPictureFileNameSortOrder
Dr. Alex Ortega LoayzaFounderMedical DirectorFounder.jpg1
Corlis Watkins-NassPresidentMarketingPresident.jpg2
Dave DePottieChairmanInformation TechnologyChairman.jpg3
Lasaunia ThompsonTreasurerFundraisingTreasurer.jpg4
LaGail OdomsSecretaryDocumentationSecretary.jpg5

Content tables

ContentDocument

One document-level record is associated with a menu item. Current extract examples are placeholders with ContentType U (Unknown), WorkflowStatus D (Draft), and IsPublished 0.

Implemented columns

ColumnSQL definition
ContentDocumentIDINT IDENTITY (1, 1) NOT NULL
MenuItemIDINT NOT NULL
ContentTypeCHAR (1) NOT NULL
DescriptionNVARCHAR (500) NOT NULL
MetaDataNVARCHAR (MAX) NOT NULL
WorkflowStatusCHAR (1) DEFAULT ('D') NOT NULL
IsPublishedBIT NOT NULL
PublishedDateDATETIME2 (0) NULL
CreatedDateDATETIME2 (0) CONSTRAINT [DF_ContentDocument_CreatedDate] DEFAULT (sysdatetime()) NOT NULL
ModifiedDateDATETIME2 (0) CONSTRAINT [DF_ContentDocument_ModifiedDate] DEFAULT (sysdatetime()) NOT NULL

Constraints and foreign keys

NameDefinition
DF_ContentDocument_CreatedDateCONSTRAINT [DF_ContentDocument_CreatedDate] DEFAULT (sysdatetime()) NOT NULL
DF_ContentDocument_ModifiedDateCONSTRAINT [DF_ContentDocument_ModifiedDate] DEFAULT (sysdatetime()) NOT NULL
PK_ContentDocumentCONSTRAINT [PK_ContentDocument] PRIMARY KEY CLUSTERED ([ContentDocumentID] ASC)
CK_ContentDocument_MetaData_IsJSONCONSTRAINT [CK_ContentDocument_MetaData_IsJSON] CHECK (isjson([MetaData])=(1))
FK_ContentDocument_ContentTypeCONSTRAINT [FK_ContentDocument_ContentType] FOREIGN KEY ([ContentType]) REFERENCES [dbo].[ContentType] ([Code])
FK_ContentDocument_MenuItemCONSTRAINT [FK_ContentDocument_MenuItem] FOREIGN KEY ([MenuItemID]) REFERENCES [dbo].[MenuItem] ([MenuItemID]) ON DELETE CASCADE
FK_ContentDocument_WorkflowStatusCONSTRAINT [FK_ContentDocument_WorkflowStatus] FOREIGN KEY ([WorkflowStatus]) REFERENCES [dbo].[WorkflowStatus] ([Code])

Sample Data

ContentDocumentIDMenuItemIDContentTypeDescriptionWorkflowStatusIsPublished
18UAbout PGD0
29UWhat is PGD0
1118UEmotional JourneyD0
1825UEmotional JourneyD0
2532UEmotional JourneyD0
3138UBeing a ProviderD0
3239UEarly DiagnosisD0

ContentElement

Stores a content block’s format, media type, block information, and text, binary, or file content. It has no persisted SortOrder, so the schema does not define editorial order for multiple blocks. No authored content elements appear in the supplied extract.

Implemented columns

ColumnSQL definition
ContentElementIDINT IDENTITY (1, 1) NOT NULL
ContentDocumentIDINT NOT NULL
FormatTypeCHAR (1) NOT NULL
MimeTypeCHAR (1) NOT NULL
BlockInfoNVARCHAR (MAX) NOT NULL
TextContentNVARCHAR (MAX) NULL
BinaryContentVARBINARY (MAX) NULL
LocalFilePathNVARCHAR (255) NULL
ExternalFilePathNVARCHAR (255) NULL
CreatedDateDATETIME2 (0) CONSTRAINT [DF_ContentElement_CreatedDate] DEFAULT (sysdatetime()) NOT NULL
ModifiedDateDATETIME2 (0) CONSTRAINT [DF_ContentElement_ModifiedDate] DEFAULT (sysdatetime()) NOT NULL

Constraints and foreign keys

NameDefinition
DF_ContentElement_CreatedDateCONSTRAINT [DF_ContentElement_CreatedDate] DEFAULT (sysdatetime()) NOT NULL
DF_ContentElement_ModifiedDateCONSTRAINT [DF_ContentElement_ModifiedDate] DEFAULT (sysdatetime()) NOT NULL
PK_ContentElementCONSTRAINT [PK_ContentElement] PRIMARY KEY CLUSTERED ([ContentElementID] ASC)
CK_ContentElement_BlockInfo_IsJSONCONSTRAINT [CK_ContentElement_BlockInfo_IsJSON] CHECK (isjson([BlockInfo])=(1))
FK_ContentElement_ContentDocumentCONSTRAINT [FK_ContentElement_ContentDocument] FOREIGN KEY ([ContentDocumentID]) REFERENCES [dbo].[ContentDocument] ([ContentDocumentID]) ON DELETE CASCADE
FK_ContentElement_FormatTypeCONSTRAINT [FK_ContentElement_FormatType] FOREIGN KEY ([FormatType]) REFERENCES [dbo].[FormatType] ([Code])
FK_ContentElement_MimeTypeCONSTRAINT [FK_ContentElement_MimeType] FOREIGN KEY ([MimeType]) REFERENCES [dbo].[MimeType] ([Code])

Sample Data

Sample status
NO DATA AVAILABLE

Staging tables

StagingDocument

Holds a content document while it is being prepared. No staging rows are included in the supplied extract.

Implemented columns

ColumnSQL definition
StagingDocumentIDINT IDENTITY (1, 1) NOT NULL
StagingMenuItemIDINT NULL
ContentTypeCHAR (1) NOT NULL
DescriptionNVARCHAR (500) NOT NULL
MetadataNVARCHAR (MAX) NOT NULL
WorkflowStatusCHAR (1) NOT NULL
CreatedDateDATETIME2 (0) CONSTRAINT [DF_StagingDocument_CreatedDate] DEFAULT (sysdatetime()) NOT NULL
ModifiedDateDATETIME2 (0) CONSTRAINT [DF_StagingDocument_ModifiedDate] DEFAULT (sysdatetime()) NOT NULL

Constraints and foreign keys

NameDefinition
DF_StagingDocument_CreatedDateCONSTRAINT [DF_StagingDocument_CreatedDate] DEFAULT (sysdatetime()) NOT NULL
DF_StagingDocument_ModifiedDateCONSTRAINT [DF_StagingDocument_ModifiedDate] DEFAULT (sysdatetime()) NOT NULL
PK_StagingDocumentCONSTRAINT [PK_StagingDocument] PRIMARY KEY CLUSTERED ([StagingDocumentID] ASC)
CK_StagingDocument_Metadata_IsJSONCONSTRAINT [CK_StagingDocument_Metadata_IsJSON] CHECK (isjson([Metadata])=(1))
FK_StagingDocument_ContentTypeCONSTRAINT [FK_StagingDocument_ContentType] FOREIGN KEY ([ContentType]) REFERENCES [dbo].[ContentType] ([Code])
FK_StagingDocument_StagingMenuItemCONSTRAINT [FK_StagingDocument_StagingMenuItem] FOREIGN KEY ([StagingMenuItemID]) REFERENCES [dbo].[StagingMenuItem] ([StagingMenuItemID])

Sample Data

Sample status
NO DATA AVAILABLE

StagingElement

Holds a text, media, or file block associated with a staged document.

Implemented columns

ColumnSQL definition
StagingElementIDINT IDENTITY (1, 1) NOT NULL
StagingDocumentIDINT NOT NULL
WorkflowStatusCHAR (1) NOT NULL
FormatTypeCHAR (1) NOT NULL
MimeTypeCHAR (1) NOT NULL
BlockInfoNVARCHAR (MAX) NOT NULL
TextContentNVARCHAR (MAX) NULL
BinaryContentVARBINARY (MAX) NULL
LocalFilePathNVARCHAR (255) NULL
ExternalFilePathNVARCHAR (255) NULL
CreatedDateDATETIME2 (0) CONSTRAINT [DF_StagingElement_CreatedDate] DEFAULT (sysdatetime()) NOT NULL
ModifiedDateDATETIME2 (0) CONSTRAINT [DF_StagingElement_ModifiedDate] DEFAULT (sysdatetime()) NOT NULL

Constraints and foreign keys

NameDefinition
DF_StagingElement_CreatedDateCONSTRAINT [DF_StagingElement_CreatedDate] DEFAULT (sysdatetime()) NOT NULL
DF_StagingElement_ModifiedDateCONSTRAINT [DF_StagingElement_ModifiedDate] DEFAULT (sysdatetime()) NOT NULL
PK_StagingElementCONSTRAINT [PK_StagingElement] PRIMARY KEY CLUSTERED ([StagingElementID] ASC)
CK_StagingElement_BlockInfo_IsJSONCONSTRAINT [CK_StagingElement_BlockInfo_IsJSON] CHECK (isjson([BlockInfo])=(1))
FK_StagingElement_FormatTypeCONSTRAINT [FK_StagingElement_FormatType] FOREIGN KEY ([FormatType]) REFERENCES [dbo].[FormatType] ([Code])
FK_StagingElement_MimeTypeCONSTRAINT [FK_StagingElement_MimeType] FOREIGN KEY ([MimeType]) REFERENCES [dbo].[MimeType] ([Code])
FK_StagingElement_StagingDocumentCONSTRAINT [FK_StagingElement_StagingDocument] FOREIGN KEY ([StagingDocumentID]) REFERENCES [dbo].[StagingDocument] ([StagingDocumentID])
FK_StagingElement_WorkflowStatusCONSTRAINT [FK_StagingElement_WorkflowStatus] FOREIGN KEY ([WorkflowStatus]) REFERENCES [dbo].[WorkflowStatus] ([Code])

Sample Data

Sample status
NO DATA AVAILABLE

Registration tables

Registration

Stores the email address, visitor type, optional account credentials, and participation preferences.

Implemented columns

ColumnSQL definition
RegistrationIDINT IDENTITY (1, 1) NOT NULL
EmailNVARCHAR (500) NOT NULL
PasswordHashVARBINARY (256) NULL
PasswordSaltVARBINARY (256) NULL
VisitorTypeCHAR (1) NOT NULL
IsMemberBIT NOT NULL
IsVolunteerBIT NOT NULL
IsNewsLetterBIT NOT NULL
IsFundraisingBIT NOT NULL
IsActiveBIT NOT NULL
CreatedDateDATETIME2 (0) CONSTRAINT [DF_Registration_CreatedDate] DEFAULT (sysdatetime()) NOT NULL
ModifiedDateDATETIME2 (0) CONSTRAINT [DF_Registration_ModifiedDate] DEFAULT (sysdatetime()) NOT NULL

Constraints and foreign keys

NameDefinition
DF_Registration_CreatedDateCONSTRAINT [DF_Registration_CreatedDate] DEFAULT (sysdatetime()) NOT NULL
DF_Registration_ModifiedDateCONSTRAINT [DF_Registration_ModifiedDate] DEFAULT (sysdatetime()) NOT NULL
Unnamed PRIMARY KEYPRIMARY KEY CLUSTERED ([RegistrationID] ASC)
FK_Registration_VisitorTypeCONSTRAINT [FK_Registration_VisitorType] FOREIGN KEY ([VisitorType]) REFERENCES [dbo].[VisitorType] ([Code])
UQ_Registration_EmailCONSTRAINT [UQ_Registration_Email] UNIQUE NONCLUSTERED ([Email] ASC)

Sample Data

Sample status
NO DATA AVAILABLE

Contact

Stores a registrant’s name and optional contact and address details.

Implemented columns

ColumnSQL definition
ContactIDINT IDENTITY (1, 1) NOT NULL
RegistrationIDINT NOT NULL
FirstNameVARCHAR (100) NOT NULL
LastNameVARCHAR (100) NOT NULL
MiddleNameVARCHAR (100) NULL
MobilePhoneVARCHAR (20) NULL
HomePhoneVARCHAR (20) NULL
WorkPhoneVARCHAR (20) NULL
WorkEmailVARCHAR (500) NULL
AddressLine1VARCHAR (200) NULL
AddressLine2VARCHAR (200) NULL
ForeignAddressVARCHAR (500) NULL
CityVARCHAR (100) NULL
StateProvinceVARCHAR (100) NULL
PostalCodeVARCHAR (20) NULL
CountryVARCHAR (100) NULL
DateOfBirthDATE NULL
CreatedDateDATETIME2 (0) CONSTRAINT [DF_Contact_CreatedDate] DEFAULT (sysdatetime()) NOT NULL
ModifiedDateDATETIME2 (0) CONSTRAINT [DF_Contact_ModifiedDate] DEFAULT (sysdatetime()) NOT NULL

Constraints and foreign keys

NameDefinition
DF_Contact_CreatedDateCONSTRAINT [DF_Contact_CreatedDate] DEFAULT (sysdatetime()) NOT NULL
DF_Contact_ModifiedDateCONSTRAINT [DF_Contact_ModifiedDate] DEFAULT (sysdatetime()) NOT NULL
Unnamed PRIMARY KEYPRIMARY KEY CLUSTERED ([ContactID] ASC)
FK_Contact_RegistrationCONSTRAINT [FK_Contact_Registration] FOREIGN KEY ([RegistrationID]) REFERENCES [dbo].[Registration] ([RegistrationID])

Sample Data

Sample status
NO DATA AVAILABLE

Newsletter

Connects a content document to a newsletter description and its distribution and publication dates.

Implemented columns

ColumnSQL definition
NewsletterIDINT IDENTITY (1, 1) NOT NULL
ContentDocumentIDINT NOT NULL
DescriptionNVARCHAR (MAX) NOT NULL
NewsletterTypeCHAR (1) NOT NULL
DistributionDateDATETIME2 (7) DEFAULT (sysutcdatetime()) NOT NULL
PublishDateDATETIME2 (7) DEFAULT (sysutcdatetime()) NOT NULL
CreatedDateDATETIME2 (0) CONSTRAINT [DF_Newsletter_CreatedDate] DEFAULT (sysdatetime()) NOT NULL
ModifiedDateDATETIME2 (0) CONSTRAINT [DF_Newsletter_ModifiedDate] DEFAULT (sysdatetime()) NOT NULL

Constraints and foreign keys

NameDefinition
DF_Newsletter_CreatedDateCONSTRAINT [DF_Newsletter_CreatedDate] DEFAULT (sysdatetime()) NOT NULL
DF_Newsletter_ModifiedDateCONSTRAINT [DF_Newsletter_ModifiedDate] DEFAULT (sysdatetime()) NOT NULL
Unnamed PRIMARY KEYPRIMARY KEY CLUSTERED ([NewsletterID] ASC)

Sample Data

Sample status
NO DATA AVAILABLE

Email

Stores the subject and body of a message and when it was sent.

Implemented columns

ColumnSQL definition
EmailIDINT IDENTITY (1, 1) NOT NULL
SubjectVARCHAR (200) NOT NULL
BodyTextNVARCHAR (MAX) NULL
SentDateDATETIME2 (7) NULL
CreatedDateDATETIME2 (0) CONSTRAINT [DF_Email_CreatedDate] DEFAULT (sysdatetime()) NOT NULL
ModifiedDateDATETIME2 (0) CONSTRAINT [DF_Email_ModifiedDate] DEFAULT (sysdatetime()) NOT NULL

Constraints and foreign keys

NameDefinition
DF_Email_CreatedDateCONSTRAINT [DF_Email_CreatedDate] DEFAULT (sysdatetime()) NOT NULL
DF_Email_ModifiedDateCONSTRAINT [DF_Email_ModifiedDate] DEFAULT (sysdatetime()) NOT NULL
Unnamed PRIMARY KEYPRIMARY KEY CLUSTERED ([EmailID] ASC)

Sample Data

Sample status
NO DATA AVAILABLE

EmailRecipient

Connects a message to a registration and can record when it was sent.

Implemented columns

ColumnSQL definition
EmailRecipientIDINT IDENTITY (1, 1) NOT NULL
EmailIDINT NOT NULL
RegistrationIDINT NOT NULL
DateSentDATETIME2 (7) NULL
CreatedDateDATETIME2 (0) CONSTRAINT [DF_EmailRecipient_CreatedDate] DEFAULT (sysdatetime()) NOT NULL

Constraints and foreign keys

NameDefinition
DF_EmailRecipient_CreatedDateCONSTRAINT [DF_EmailRecipient_CreatedDate] DEFAULT (sysdatetime()) NOT NULL
Unnamed PRIMARY KEYPRIMARY KEY CLUSTERED ([EmailRecipientID] ASC)
FK_EmailRecipient_EmailCONSTRAINT [FK_EmailRecipient_Email] FOREIGN KEY ([EmailID]) REFERENCES [dbo].[Email] ([EmailID]) ON DELETE CASCADE
FK_EmailRecipient_RegistrationCONSTRAINT [FK_EmailRecipient_Registration] FOREIGN KEY ([RegistrationID]) REFERENCES [dbo].[Registration] ([RegistrationID]) ON DELETE CASCADE

Sample Data

Sample status
NO DATA AVAILABLE

EmailAttachment

Stores an attached file’s name, type, and binary contents; it may also refer to a newsletter.

Implemented columns

ColumnSQL definition
EmailAttachmentIDINT IDENTITY (1, 1) NOT NULL
EmailIDINT NOT NULL
NewsLetterIDINT NULL
FileNameVARCHAR (255) NOT NULL
FileTypeVARCHAR (50) NOT NULL
FileDataVARBINARY (MAX) NOT NULL
CreatedDateDATETIME2 (0) CONSTRAINT [DF_EmailAttachment_CreatedDate] DEFAULT (sysdatetime()) NOT NULL

Constraints and foreign keys

NameDefinition
DF_EmailAttachment_CreatedDateCONSTRAINT [DF_EmailAttachment_CreatedDate] DEFAULT (sysdatetime()) NOT NULL
Unnamed PRIMARY KEYPRIMARY KEY CLUSTERED ([EmailAttachmentID] ASC)
FK_EmailAttachment_EmailCONSTRAINT [FK_EmailAttachment_Email] FOREIGN KEY ([EmailID]) REFERENCES [dbo].[Email] ([EmailID])
FK_EmailAttachment_NewsletterCONSTRAINT [FK_EmailAttachment_Newsletter] FOREIGN KEY ([NewsLetterID]) REFERENCES [dbo].[Newsletter] ([NewsletterID])

Sample Data

Sample status
NO DATA AVAILABLE

Other SQL project tables

These supporting, migration, audit, and legacy tables are not assigned a TableType in SystemTables. No sample records are available for them in the supplied project data.

EmailRequest

Holds a requested message, its processing state, and the resulting EmailID when processed.

Implemented columns

ColumnSQL definition
EmailRequestIDINT IDENTITY (1, 1) NOT NULL
RegistrationIDINT NULL
RequestTypeCHAR (1) NOT NULL
SubjectNVARCHAR (200) NOT NULL
RequestBodyNVARCHAR (MAX) NOT NULL
IsProcessedBIT NOT NULL CONSTRAINT [DF_EmailRequest_IsProcessed] DEFAULT ((0))
ProcessedDateDATETIME2 (7) NULL
ProcessedEmailIDINT NULL
CreatedDateDATETIME2 (0) CONSTRAINT [DF_EmailRequest_CreatedDate] DEFAULT (sysdatetime()) NOT NULL
ModifiedDateDATETIME2 (0) CONSTRAINT [DF_EmailRequest_ModifiedDate] DEFAULT (sysdatetime()) NOT NULL

Constraints and foreign keys

NameDefinition
DF_EmailRequest_IsProcessedCONSTRAINT [DF_EmailRequest_IsProcessed] DEFAULT ((0))
DF_EmailRequest_CreatedDateCONSTRAINT [DF_EmailRequest_CreatedDate] DEFAULT (sysdatetime()) NOT NULL
DF_EmailRequest_ModifiedDateCONSTRAINT [DF_EmailRequest_ModifiedDate] DEFAULT (sysdatetime()) NOT NULL
Unnamed PRIMARY KEYPRIMARY KEY CLUSTERED ([EmailRequestID] ASC)
FK_EmailRequest_RegistrationCONSTRAINT [FK_EmailRequest_Registration] FOREIGN KEY ([RegistrationID]) REFERENCES [dbo].[Registration] ([RegistrationID])
FK_EmailRequest_EmailCONSTRAINT [FK_EmailRequest_Email] FOREIGN KEY ([ProcessedEmailID]) REFERENCES [dbo].[Email] ([EmailID])

Sample Data

Sample status
NO DATA AVAILABLE

MasterMenu_Stage

Menu-import staging rows with a load order and source menu fields.

Implemented columns

ColumnSQL definition
LoadOrderINT IDENTITY (1, 1) NOT NULL
ParentNVARCHAR (100) NOT NULL
ChildNVARCHAR (100) NOT NULL
SubMenuNVARCHAR (100) NOT NULL
TypeNVARCHAR (10) NOT NULL
VisitorMaskNVARCHAR (20) NULL
RouteTypeNVARCHAR (10) NULL
RouteTargetNVARCHAR (200) NULL
DescriptionNVARCHAR (200) NOT NULL
NotesNVARCHAR (200) NULL

No constraints are declared in this table definition.

Sample Data

Sample status
NO DATA AVAILABLE

MasterMenuStage

Holds imported menu fields in the second menu-import staging table.

Implemented columns

ColumnSQL definition
MenuIDINT IDENTITY (1, 1) NOT NULL
ParentNVARCHAR (100) NOT NULL
ChildNVARCHAR (100) NOT NULL
SubMenuNVARCHAR (100) NOT NULL
VisitorMaskNVARCHAR (20) NULL
RouteTypeNVARCHAR (10) NULL
RouteTargetNVARCHAR (200) NULL
DescriptionNVARCHAR (200) NOT NULL
NotesNVARCHAR (200) NULL

No constraints are declared in this table definition.

Sample Data

Sample status
NO DATA AVAILABLE

Stores menu-specific test cases, expected outcomes, and processing results.

Implemented columns

ColumnSQL definition
TestIDINT NOT NULL
ParentTestIDINT NULL
CategoryVARCHAR (50) NOT NULL
TypeCHAR (1) NOT NULL
DescriptionNVARCHAR (300) NOT NULL
ExpectedVARCHAR (10) NOT NULL
ResultVARCHAR (10) NULL
IsErrorBIT NULL
NotesNVARCHAR (500) NULL
TitleNVARCHAR (200) NULL
RouteTypeCHAR (1) NULL
RouteTargetNVARCHAR (200) NULL
VisitorMaskVARCHAR (10) NULL
SortOrderINT NULL
IsActiveBIT NULL
IsProcessedBIT NULL

No constraints are declared in this table definition.

Sample Data

Sample status
NO DATA AVAILABLE

MigrationDocument

Holds captured legacy page titles, content classifications, descriptions, and metadata.

Implemented columns

ColumnSQL definition
MigrationDocumentIDINT IDENTITY (1, 1) NOT NULL
MenuTitleNVARCHAR (200) NOT NULL
ContentTypeCHAR (1) NOT NULL
DescriptionNVARCHAR (500) NOT NULL
MetaDataNVARCHAR (MAX) NOT NULL
CreatedDateDATETIME2 (0) CONSTRAINT [DF_Migration_CreatedDate] DEFAULT (sysdatetime()) NOT NULL
ModifiedDateDATETIME2 (0) CONSTRAINT [DF_Migration_ModifiedDate] DEFAULT (sysdatetime()) NOT NULL

Constraints and foreign keys

NameDefinition
DF_Migration_CreatedDateCONSTRAINT [DF_Migration_CreatedDate] DEFAULT (sysdatetime()) NOT NULL
DF_Migration_ModifiedDateCONSTRAINT [DF_Migration_ModifiedDate] DEFAULT (sysdatetime()) NOT NULL
PK_MigrationCONSTRAINT [PK_Migration] PRIMARY KEY CLUSTERED ([MigrationDocumentID] ASC)
CK_MigrationDocument_MetaData_IsJSONCONSTRAINT [CK_MigrationDocument_MetaData_IsJSON] CHECK (isjson([MetaData])=(1))

Sample Data

Sample status
NO DATA AVAILABLE

MigrationElement

Holds a captured text or media block associated with a legacy document.

Implemented columns

ColumnSQL definition
MigrationElementIDINT IDENTITY (1, 1) NOT NULL
MigrationDocumentIDINT NOT NULL
FormatTypeCHAR (1) NOT NULL
MimeTypeCHAR (1) NOT NULL
BlockInfoNVARCHAR (MAX) NOT NULL
TextMigrationNVARCHAR (MAX) NULL
BinaryMigrationVARBINARY (MAX) NULL
LocalFilePathNVARCHAR (255) NULL
ExternalFilePathNVARCHAR (255) NULL
CreatedDateDATETIME2 (0) CONSTRAINT [DF_MigrationElement_CreatedDate] DEFAULT (sysdatetime()) NOT NULL
ModifiedDateDATETIME2 (0) CONSTRAINT [DF_MigrationElement_ModifiedDate] DEFAULT (sysdatetime()) NOT NULL

Constraints and foreign keys

NameDefinition
DF_MigrationElement_CreatedDateCONSTRAINT [DF_MigrationElement_CreatedDate] DEFAULT (sysdatetime()) NOT NULL
DF_MigrationElement_ModifiedDateCONSTRAINT [DF_MigrationElement_ModifiedDate] DEFAULT (sysdatetime()) NOT NULL
PK_MigrationElementCONSTRAINT [PK_MigrationElement] PRIMARY KEY CLUSTERED ([MigrationElementID] ASC)
CK_MigrationElement_BlockInfo_IsJSONCONSTRAINT [CK_MigrationElement_BlockInfo_IsJSON] CHECK (isjson([BlockInfo])=(1))
FK_MigrationElement_FormatTypeCONSTRAINT [FK_MigrationElement_FormatType] FOREIGN KEY ([FormatType]) REFERENCES [dbo].[FormatType] ([Code])
FK_MigrationElement_MigrationDocumentCONSTRAINT [FK_MigrationElement_MigrationDocument] FOREIGN KEY ([MigrationDocumentID]) REFERENCES [dbo].[MigrationDocument] ([MigrationDocumentID]) ON DELETE CASCADE
FK_MigrationElement_MimeTypeCONSTRAINT [FK_MigrationElement_MimeType] FOREIGN KEY ([MimeType]) REFERENCES [dbo].[MimeType] ([Code])

Sample Data

Sample status
NO DATA AVAILABLE

MigrationMapping

Connects an old menu title to its destination MenuItemID and records whether the match is correct.

Implemented columns

ColumnSQL definition
MigrationMappingIDINT IDENTITY (1, 1) NOT NULL
OldMenuTitleNVARCHAR (200) NOT NULL
MenuItemIDINT NULL
IsCorrectBIT NULL

No constraints are declared in this table definition.

Sample Data

Sample status
NO DATA AVAILABLE

StagingMenuItem

Holds a menu hierarchy and routes before they become active MenuItem records.

Implemented columns

ColumnSQL definition
StagingMenuItemIDINT IDENTITY (1, 1) NOT NULL
ParentMenuItemIDINT NULL
TitleNVARCHAR (200) NOT NULL
RouteTypeCHAR (1) NOT NULL
RouteTargetNVARCHAR (200) NOT NULL
VisitorMaskVARCHAR (10) NOT NULL
SortOrderINT CONSTRAINT [DF_StagingMenuItem_SortOrder] DEFAULT ((0)) NOT NULL
IsActiveBIT CONSTRAINT [DF_StagingMenuItem_IsActive] DEFAULT ((1)) NOT NULL
CreatedDateDATETIME2 (0) CONSTRAINT [DF_StagingMenuItem_CreatedDate] DEFAULT (sysdatetime()) NOT NULL
ModifiedDateDATETIME2 (0) CONSTRAINT [DF_StagingMenuItem_ModifiedDate] DEFAULT (sysdatetime()) NOT NULL

Constraints and foreign keys

NameDefinition
DF_StagingMenuItem_SortOrderCONSTRAINT [DF_StagingMenuItem_SortOrder] DEFAULT ((0)) NOT NULL
DF_StagingMenuItem_IsActiveCONSTRAINT [DF_StagingMenuItem_IsActive] DEFAULT ((1)) NOT NULL
DF_StagingMenuItem_CreatedDateCONSTRAINT [DF_StagingMenuItem_CreatedDate] DEFAULT (sysdatetime()) NOT NULL
DF_StagingMenuItem_ModifiedDateCONSTRAINT [DF_StagingMenuItem_ModifiedDate] DEFAULT (sysdatetime()) NOT NULL
PK_StagingMenuItemCONSTRAINT [PK_StagingMenuItem] PRIMARY KEY CLUSTERED ([StagingMenuItemID] ASC)
CK_StagingMenuItem_SortOrderCONSTRAINT [CK_StagingMenuItem_SortOrder] CHECK ([SortOrder]>=(0))
CK_StagingMenuItem_Title_NormalizedCONSTRAINT [CK_StagingMenuItem_Title_Normalized] CHECK (NOT [Title] like '%[%?=&#:/\<>]%')
CK_StagingMenuItem_VisitorMaskCONSTRAINT [CK_StagingMenuItem_VisitorMask] CHECK (NOT [VisitorMask] like '%[^PCMDVR]%' AND len([VisitorMask])>(0))
FK_StagingMenuItem_ParentCONSTRAINT [FK_StagingMenuItem_Parent] FOREIGN KEY ([ParentMenuItemID]) REFERENCES [dbo].[StagingMenuItem] ([StagingMenuItemID])
FK_StagingMenuItem_RouteTypeCONSTRAINT [FK_StagingMenuItem_RouteType] FOREIGN KEY ([RouteType]) REFERENCES [dbo].[RouteType] ([Code])
UQ_StagingMenuItem_Title_RouteType_VisitorMaskCONSTRAINT [UQ_StagingMenuItem_Title_RouteType_VisitorMask] UNIQUE NONCLUSTERED ([Title] ASC, [RouteType] ASC, [VisitorMask] ASC)

Sample Data

Sample status
NO DATA AVAILABLE

SystemSettings_Audit

Keeps prior setting values and the dates they were last updated and audited.

Implemented columns

ColumnSQL definition
AuditIDINT IDENTITY (1, 1) NOT NULL
SettingIDINT NOT NULL
SettingKeyVARCHAR (50) NOT NULL
SettingTypeVARCHAR (50) NOT NULL
SettingGroupVARCHAR (50) NOT NULL
SettingValueSQL_VARIANT NULL
LastUpdatedDATETIME2 (7) NOT NULL
AuditDateDATETIME2 (7) DEFAULT (sysdatetime()) NOT NULL

Constraints and foreign keys

NameDefinition
Unnamed PRIMARY KEYPRIMARY KEY CLUSTERED ([AuditID] ASC)

Sample Data

Sample status
NO DATA AVAILABLE

Database objects

The following lists cover every view, function, and stored procedure in the database project. They summarize each object by its role.

Views

NamePurpose
ContentDocumentListProvides a unified view of ContentDocument records joined with MenuItem, RouteType, ContentType, and WorkflowStatus metadata for validation and reporting.
ContentElementListProvides a unified view of ContentElement records joined with ContentDocument, MenuItem, RouteType, ContentType, FormatType, MimeType, and WorkflowStatus metadata for validation and reporting.
MasterMenuListProvides the imported MasterMenu rows with a resolved Title based on the populated hierarchy column and resolved menu and content mappings.
MenuItemListProvides a unified view of MenuItem records joined with ContentDocument and parent MenuItem metadata for validation and reporting.
MissingPlaceholdersLists content-route menu items that do not yet have a ContentDocument placeholder.
MissingTableListReturns all tables from TableList that do not currently exist in the database. Used to determine which lookup tables must be created.
PatientRegistryReturns all Registration records that are Patients
RegistrationListReturns all Registration records joined to Contact
StagingDocumentListProvides a unified view of StagingDocument joined to StagingMenuItem with RouteType, ContentType and WorkflowStatus descriptions.
StagingElementListShows staged content elements with their staged document, menu, and lookup details.
StagingMenuItemListShows staged menu items with parent, route, and staged content details.
TableListReturns metadata for all system tables including existence, column count, index count, constraint count, record count, and creation/modification timestamps.

Functions

NamePurpose
Create_MetaDataGenerates a standardized JSON metadata object for documenting content. Accepts title, author, description, category, and comma-separated tags, returning a structured JSON object with creation/modification timestamps.
Get_SystemSettingReturns the SettingValue for a given SettingKey from the SystemSettings table. Returns NULL if the key is invalid or not found.
Get_TableListReturns a comma‑separated list of table names from SystemTables ordered by SortOrder. Accepts a table type filter such as 'Lookup', 'System', 'Content', etc. Use ALL, null, or empty string for all tables.
Normalize_ErrorMessageNormalizes an error or debug message by removing trailing punctuation unless the message ends with an allowed emphasis sequence.
Normalize_RouteTargetBuilds a route target from the route type and supplied value, validating visitor, page, redirect, or content targets.
Normalize_RouteTypeUppercases a route type and returns its code only when it exists in RouteType.
Normalize_SettingKeyNormalizes a slug with optional uppercasing and a configurable separator. Despite its name, it processes a slug input rather than a setting key.
Normalize_SlugNormalizes a slug string by converting to lowercase, replacing spaces with hyphens, removing special characters, and cleaning up multiple/leading/trailing hyphens. Returns a URL-friendly slug string.
Normalize_TitleCleans a title string for safe use in URLs and query strings. Trims whitespace, removes URL-breaking characters, and collapses multiple spaces into a single space.
Normalize_TokenNormalizes a single token by trimming whitespace, removing all non-alphanumeric characters, and converting the result to uppercase.
Normalize_VisitorMaskUppercases and validates visitor codes, removes duplicates, orders them by VisitorType, and expands ALL or A to the full mask.
SplitCSVRowSplits one CSV row into its field values while respecting quoted fields.
TableExistsReturns 1 if a table exists in the dbo schema, otherwise 0.
TablesExistsChecks whether all requested tables exist in the database.
Validate_UrlValidates an external URL string without using regular expressions. This function is intentionally strict and only accepts true external URLs. Accepts: - absolute URLs starting with http:// or https:// - hostnames such as example.com or www.example.com - hostnames with paths or queries - IPv4 addresses with optional paths Rejects: - internal paths starting with / - email addresses - non-http schemes (mailto:, ftp:, file:, tel:, sms:, etc.) - malformed URLs - protocol-relative URLs (//example.com) - file paths - query-only or fragment-only strings Returns 1 if valid, 0 otherwise.

Stored procedures

NamePurpose
Clear_ErrorLogClears the ErrorLog table, reseeds the identity, inserts an initialization record, and logs opening and closing messages tied to @LogDate.
Create_BoardMember_TableDrops and recreates the BoardMember table. Not part of the content system (no ContentType) -- the Board of Directors page is a static Page route (RouteType='P') that queries this table directly. Bio is deferred (not yet a column).
Create_Content_MetaDataGenerates a standardized JSON metadata object for ContentDocument metadata. Accepts title, author, description, a category token, and a comma-separated list of tags, returning a structured JSON object with standard timestamps and version information.
Create_Content_TablesCreates ContentDocument and ContentElement tables using refactored naming conventions and JSON validation rules.
Create_Element_MetaDataGenerates a standardized JSON metadata object for content elements. Controls placement and tagging of the element within the content body.
Create_ErrorLog_TableDrops and recreates the ErrorLog table using the latest schema standards. Inserts an initialization record and logs opening and closing messages tied to @LogDate.
Create_Lookup_TablesDrops and recreates all lookup tables, removes dependent foreign keys, repopulates lookup tables, and restores foreign key constraints.
Create_MasterMenu_TableDrops and recreates the MasterMenu table used to store the raw menu definition imported from the MASTER_MENU CSV. The location of the file is a system setting
Create_Menu_TablesCreates the master-menu and menu-related tables.
Create_MenuItem_TableDrops and recreates the MenuItem table. Removes foreign key references from StagingDocument and ContentDocument, deletes all MenuItem records, recreates the table with full constraints, and optionally populates initial menu items.
Create_Migration_TablesCreates the legacy migration document, element, and mapping tables.
Create_Numbers_TableCreates and populates the Numbers tally table used by normalization functions. Recreates the table each time.
Create_PortalMenu_TableCreates the PortalMenu table for visitor-specific portal tiles.
Create_Registration_TablesCreate all the tables needed for Registration and various contacts with users
Create_Staging_TablesCreates staging tables used for temporary content processing. Drops existing staging tables and recreates them with full constraints. Requires lookup tables to exist first.
Create_System_TablesRecreates all core system tables if missing. Each table creation procedure is responsible for its own existence check. This routine simply orchestrates the creation of ErrorLog, SystemTables, SystemSettings, and Numbers tables.
Create_SystemSettings_TableDrops and recreates the SystemSettings and SystemSettings_Audit tables. Applies all validation constraints and initializes settings using Populate_SystemSettings.
Create_SystemTables_TableDrops and recreates the SystemTables lookup table, then inserts canonical system, lookup, content, staging, and menu table definitions.
Create_TableList_TableLegacy routine that creates and seeds a physical TableList table. The current project defines TableList as a view, so this routine appears outdated.
Create_TablesCreates all tables needed for the AllThingsPG database including system, lookup, menu, content, and staging tables. Executes individual table procedures in correct dependency order.
Create_TempTable_FromCSVReads the header row of a CSV file and dynamically creates a global temp table (##MenuCSV) with one NVARCHAR(MAX) column per header field.
Create_TestHarness_TableDrops and recreates the TestHarness table used for testing menus
Delete_ContentDeletes ContentDocument and related ContentElement records based on ContentDocumentID or MenuItemID Supports full purge with identity reseed
Delete_MenuItemDeletes a single MenuItem or all MenuItem records depending on the DeleteAll flag. Includes validation, reseeding, and full error handling.
Delete_StagingDeletes StagingDocument and StagingElement records based on StagingDocumentID or StagingMenuItemID Supports full purge with identity reseed
Execute_TestHarnessExecutes the TestHarness table to insert parent and child MenuItems into StagingMenuItem table, capturing MenuItemID and ContentDocumentID results and marking tests as PASS/FAIL based on Expected vs Actual.
Get_RouteTypeNormalizes a RouteType value by trimming whitespace, uppercasing the input, validating length, and returning the matching RouteType.Code value.
Get_SystemInfoRetrieves a system setting by key. Returns the raw sql_variant value via output parameter. Throws if the key is not found.
Initialize_DatabaseInitializes the database by 1) creating missing 2) clearing logs 3) deleting core data 4) reseeding identities 5) repopulating system tables
Insert_BoardMemberInserts a new BoardMember record.
Insert_Content_PlaceholderInserts a content record for a MenuItem that does not have one. Validates MenuItemID and Title before creating the ContentDocument record.
Insert_ContentDocumentInserts a new ContentDocument record after validating content type, workflow status, JSON metadata, and ensuring only one ContentDocument exists per MenuItemID.
Insert_ContentElementInserts a new ContentElement record linked to a ContentDocument. Validates ContentDocumentID, FormatType, MimeType and JSON format for BlockInfo. Enforces mutual exclusivity between TextContent and BinaryContent.
Insert_EmailRequestInserts a new outbound email request tied to a Registration when available.
Insert_MenuItemInserts a StagingMenuItem record with full validation, normalization, auto-sort ordering, placeholder creation, and full logging/error handling
Insert_MenuItem_ChildInserts a child MenuItem under a specified parent. Inherits RouteType, VisitorMask, and IsActive when not supplied. Auto-generates RouteTarget and SortOrder when needed.
Insert_MenuItem_ParentAdds a parent menu item to the staging menu.
Insert_MissingContentPlaceholdersIterates through all MenuItems with RouteType = 'C' and ensures each has a ContentDocument placeholder. Calls Insert_Content_Placeholder for any missing ContentDocument record.
Insert_RegistrationInserts a new Registration + Contact, or if a Registration already exists for @Email, updates that Registration's VisitorType/flags and its existing Contact in place (never creates a second Registration or a second Contact for the same email).
Log_DebugInserts a debug entry into the ErrorLog table. If the table does not exist, it is created automatically and a warning entry is logged. Used by all procedures to record debug messages tied to a specific LogDate.
Log_ErrorInserts an error entry into the ErrorLog table. If the table does not exist, it is created automatically and a warning entry is logged. This procedure is used by all error handling blocks to ensure consistent logging.
Opening_MessageLogs a standard opening debug message for a procedure, ensuring consistent logging behavior tied to a specific LogDate.
Perform_MenuItem_ValidationPuts a wrapper around Validate_MenuItem and raises an error if the validation fails. Can validate StagingMenuItem or Production Outputs ErrorLog entries if debug enabled.
Perform_MigrationRuns the legacy content migration and publication process.
Perform_Table_CheckValidates required system, content, lookup, staging, and menu tables. Optionally creates missing tables based on @IsCreateMissing. Throws an exception listing missing tables when creation is disabled.
Populate_BoardMembersInserts a list of current Board Members
Populate_ContentDocumentMaster procedure to populate all content types. Currently populates articles via Populate_Staging. Validates that the Content table is empty before proceeding.
Populate_ContentTypePopulates the ContentType table with the standard content type definitions used throughout the system. Clears existing rows and inserts deterministic values.
Populate_FormatTypePopulates the FormatType table with the standard format type definitions used throughout the system. Clears existing rows and inserts deterministic values.
Populate_Lookup_TablesPopulates all lookup tables in correct dependency order. Ensures lookup tables exist, clears MenuItem, and reloads all lookup categories with deterministic values.
Populate_MasterMenuLoads the MasterMenu table from the MASTER_MENU CSV file with the location defined in SystemSettings. Performs a direct data dump matching the CSV column order exactly. Uses a staging table to load the data first, then copies to the MasterMenu table to resequence the MenuID. 1) Establish the parent/child relationship from the heirarchy in the spreadsheet by setting ParentMenuID for each child (type = 'C') 2) Set RouteTarget when RouteType = 'V' based on the VisitorType table
Populate_MenuItemsRebuilds menu data from the configured source, validates and stages the menu, publishes MenuItem records, then refreshes portal tiles.
Populate_MimeTypePopulates the MimeType table with the standard MIME type definitions used throughout the system. Clears existing rows and inserts deterministic values.
Populate_Numbers_TablePopulates the Numbers table with values from 1 to 1000 using a recursive CTE.
Populate_PortalMenuBuilds portal tile records for menu items assigned to a single visitor type.
Populate_RegistryPopulates repeatable local demonstration registrations. The patient registry is exposed as a view over Registration records with VisitorType = 'P'. Seed records cover the available visitor types and demonstrate membership, volunteer, and newsletter preferences. Each registration receives a corresponding bogus Contact record. Fundraising is left disabled for all seed records.
Populate_RouteTypeClears and repopulates the RouteType table with the supported routing types. Validates table existence, deletes dependent MenuItem rows, and inserts the canonical routing definitions.
Populate_StagingPlaceholder procedure for staging population. Currently implements standard logging, error handling, and closing patterns without performing any data changes.
Populate_SystemSettingsPopulates the SystemSettings table with recommended baseline settings using Set_SystemSetting. Demonstrates valid examples for each supported SettingType and SettingGroup.
Populate_SystemTablesPopulates the SystemTables lookup with all system, lookup, content, staging, and menu tables in the correct sort order.
Populate_TestHarnessLoads menu items into the test harness for validation.
Populate_VisitorTypePopulates the VisitorType table with the standard visitor type codes used throughout the system. Clears existing rows and inserts deterministic values.
Populate_WorkflowStatusPopulates the WorkflowStatus table with the standard workflow status codes used throughout the system. Clears existing rows and inserts deterministic values.
Print_MessagesDisplays debug messages for a specific LogDate and optionally logs an additional message. Intended to be used inside the ClosingPattern to show debug output when @IsDebug = 1.
Publish_MigrationTransfers mapped legacy documents and elements into the content tables.
Publish_StagingPublishes StagingMenuItem into production MenuItem.
Set_SystemSettingInserts or updates a system setting value in the SystemSettings table. Performs full validation and normalization for all supported SettingTypes.
Show_Foreign_KeysReturns all foreign keys in the database, or only those referencing a specific parent table when @TableName is provided.
Show_SchemaDisplays unified schema information for one or more tables. Supports filtering by table list or table type. Validates table existence, resolves table lists, and outputs columns, indexes, and constraints.
Show_TablesReturns a filtered list of tables from TableList based on either a comma-separated list of table names or a table type such as Lookup, System, Content, Staging, or Menu.
Success_MessageWrites a standardized success message for procedures and optionally logs additional closing messages or parameters.
Validate_ContentValidates content documents and elements to ensure proper MenuItem relationships, ContentType, WorkflowStatus, RouteType, JSON metadata, and element format/mime types. Writes validation errors to ErrorLog and sets @IsValid accordingly.
Validate_DatabaseRuns all validation routines (MenuItem, Content, Staging) and aggregates their results into a single @IsValid flag. Writes validation errors to ErrorLog and supports debug output when enabled.
Validate_MenuItemValidates Staging or Production MenuItem configuration and routing rules. Checks RouteType, RouteTarget, VisitorMask, folder alignment, querystring structure, title normalization, parent relationships, and duplicate SortOrder and Title within the same parent.
Validate_StagingValidates staging content to ensure all StagingElements reference an existing StagingDocument. Writes validation errors to ErrorLog and sets @IsValid accordingly.

Back to top