Skip to content

Data Dictionary ​

Every table and every column in the Phanera schema: type, whether a value is required, size limits, defaults, keys and foreign keys, with a description wherever the model carries one.

Read it alongside the entity relationship diagram, which shows the same schema as a picture. Together they are the reference an authority — or a supplier taking over from us — needs to read a data export without reverse-engineering it.

Generated, not written

This page is generated from the Entity Framework model snapshot that produces the database migrations, so it describes the schema the application actually runs against and cannot drift from it. Regenerate with python3 generate-data-dictionary.py.

89 tables, 978 columns. Types are PostgreSQL types.

How to read a table ​

HeadingMeaning
ColumnColumn name as it appears in the database and in a CSV/JSON export
TypePostgreSQL type. Text (max n) is character varying(n)
RequiredYes — NOT NULL. No — the column may be empty
NotesPrimary key, foreign key and its delete behaviour, uniqueness, default value, and a description where the model carries one

Cases and correspondence ​

Requests ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
CategoryIdUUIDNoFK → Categories (on delete: SetNull)
ClockStopReasonTextNo—
ClockStopReasonTypeIntegerNo—
ClockStoppedBooleanYes—
ClockStoppedAtTimestamp (UTC)No—
ComplaintCategoryIdIntegerNo—
ComplaintStageIntegerNo—
ConsentGivenBooleanYes—
ConsentIpAddressText (max 45)No—
ConsentTimestampTimestamp (UTC)No—
ConsultationDeadlineTimestamp (UTC)No—
ConsultationNotesTextNo—
ConsultationRequiredBooleanYes—
ConsultationThirdPartyTextNo—
CreatedAtTimestamp (UTC)Yesdefault now()
DateReceivedTimestamp (UTC)Yes—
DeadlineDateTimestamp (UTC)Yes—
DeadlineOverriddenBooleanYesTrue once someone has set DeadlineDate by hand rather than letting the regime's rules calculate it (Ealing RFQ F03)
DeadlineOverrideReasonText (max 500)NoWhy the deadline currently stands where it does
DescriptionTextYes—
EmailMessageIdTextNoRFC 2822 Message-ID of the original inbound email that created this request
ExtensionAppliedBooleanYes—
ExtensionDaysIntegerNo—
ExtensionReasonText (max 500)No—
FeeAmountDecimalNo—
FormFieldsDataJSONYes—
IdentityVerificationRequiredBooleanYes—
IdentityVerifiedBooleanYes—
IdentityVerifiedAtTimestamp (UTC)No—
IdentityVerifiedByUserIdTextNo—
IsOnLegalHoldBooleanYesTrue while the case is under legal hold: retention is suspended and nothing about it may be disposed of, however far past its retention period it is
IsPublishedBooleanYes—
IsSpamBooleanYes—
IsTransferredBooleanYes—
IsTrashedBooleanYes—
LanguageTextYes—
LegalHoldPlacedAtTimestamp (UTC)NoWhen the current hold was placed
LegalHoldPlacedByUserIdTextNoWho placed the current hold
LegalHoldPlacedByUserNameTextNoDisplay name of LegalHoldPlacedByUserId, captured at the time
LegalHoldReasonTextNoWhy the case is held — the matter, claim or reference the hold is for
LegalHoldReviewDueAtTimestamp (UTC)NoWhen the hold falls due for review, computed at the moment it is placed from the request type's own period or the organisation's default — see LegalHoldPolicy
MergedAtTimestamp (UTC)No—
MergedIntoRequestIdUUIDNoFK → Requests (on delete: SetNull)
NotesTextNo—
OmbudsmanOutcomeText (max 50)No—
OmbudsmanReferenceNumberText (max 50)No—
OmbudsmanReferralLoggedBooleanYes—
OmbudsmanReferredAtTimestamp (UTC)No—
OmbudsmanTypeTextNo—
OrganisationIdUUIDYesFK → Organisations (on delete: Cascade)
OriginalDeadlineDateTimestamp (UTC)No—
PipelineIdUUIDNoFK → EmailPipelines (on delete: SetNull)
PublishedAtTimestamp (UTC)No—
PublishedSummaryText (max 500)No—
ReferenceNumberText (max 30)Yes—
RequestTypeIdIntegerYesFK → RequestTypes (on delete: Cascade)
RequesterEmailText (max 254)Yes—
RequesterFirstNameText (max 200)Yes—
RequesterLastNameText (max 200)Yes—
RequesterPhoneText (max 20)No—
ResponseDraftTextNo—
ResponseSentAtTimestamp (UTC)No—
SearchVectortsvectorYesWeighted full-text index over the case's own words, computed by Postgres from the row (Ealing RFQ F11)
SensitivityTextYesHandling classification (UK Government Security Classifications)
SensitivityReasonText (max 500)NoWhy the case carries the marking it does
SourceText (max 20)Yes—
Stage1ClosedAtTimestamp (UTC)No—
Stage1OutcomeTextNo—
Stage1ResponseTextNo—
Stage2ClosedAtTimestamp (UTC)No—
Stage2OutcomeTextNo—
Stage2ResponseTextNo—
StatusTextYes—
StatutoryDeadlineDateTimestamp (UTC)NoThe deadline the rules produced, captured the first time it was overridden and left alone afterwards
TitleTextNo—
TransferReasonText (max 1000)No—
TransferredAtTimestamp (UTC)No—
TransferredToAuthorityText (max 300)No—
TrashedAtTimestamp (UTC)No—

Composite indexes: (FormFieldsData, IX_Requests_FormFieldsData), (FormFieldsData, gin), (SearchVector, IX_Requests_Search), (SearchVector, GIN), (OrganisationId, ReferenceNumber), (OrganisationId, Sensitivity, IX_Requests_OrgSensitivity), (RequestTypeId, OrganisationId), (OrganisationId, Status, DeadlineDate, IX_Requests_OrgDeadline)

RequestMessages ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
BodyText (max 8000)Yes—
CreatedAtTimestamp (UTC)Yesdefault now()
EmailMessageIdText (max 500)NoRFC 2822 Message-ID header value, set on outgoing emails for reply threading
EmailSentBooleanYesWhether the message was sent as an email to the requester
IsDisclosedBooleanYesWhether this message has been selected for disclosure on the public disclosure log
OrganisationIdUUIDYes—
ReplyToMessageIdUUIDNoThe message this is a reply to, if any
RequestIdUUIDYesFK → Requests (on delete: Cascade)
SearchVectortsvectorYesWeighted full-text index over the correspondence itself — subject (A), body (B) and sender (C) — computed by Postgres from the row (Ealing RFQ F11)
SenderNameText (max 200)YesDisplay name of sender
SenderTypeText (max 20)Yes"Staff" or "Requester"
SenderUserIdTextNoStaff user ID when sent by staff, null for requester messages
SubjectText (max 500)NoOptional subject line (used as email subject when emailing the requester)

Composite indexes: (EmailMessageId, IX_RequestMessages_EmailMessageId), (SearchVector, IX_RequestMessages_Search), (SearchVector, GIN), (RequestId, CreatedAt, IX_RequestMessages_ReqCreated)

MessageAttachments ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
BlobUrlText (max 500)Yes—
FileNameText (max 255)Yes—
FileSizeBytesInteger (64-bit)Yes—
IsDisclosedBooleanYesWhether this attachment has been selected for disclosure on the public disclosure log
MessageIdUUIDYesFK → RequestMessages (on delete: Cascade)
MimeTypeText (max 100)Yes—
OrganisationIdUUIDYes—
RedactedAtTimestamp (UTC)No—
RedactedBlobUrlText (max 500)NoBlob of the redacted copy served to the public
RedactedByUserIdTextNo—
RedactedFileSizeBytesInteger (64-bit)No—
UploadedAtTimestamp (UTC)Yesdefault now()

RequestAttachments ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
AttachmentSourceText (max 20)Yes—
AttachmentTypeText (max 50)No—
BlobUrlText (max 500)Yes—
DeletedAtTimestamp (UTC)NoWhen the file was soft-deleted; drives permanent cleanup after the grace period
FileNameText (max 255)Yes—
FileSizeBytesInteger (64-bit)Yes—
IsDeletedBooleanYes—
MimeTypeText (max 100)Yes—
OrganisationIdUUIDYes—
RequestIdUUIDYesFK → Requests (on delete: Cascade)
UploadedAtTimestamp (UTC)Yesdefault now()
UploadedByUserIdTextNo—
VersionIntegerYes—

RequestTimeline ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
CreatedAtTimestamp (UTC)Yesdefault now()
DescriptionText (max 500)Yes—
EventTypeText (max 50)Yes—
MetadataTextNo—
OrganisationIdUUIDYes—
RequestIdUUIDYesFK → Requests (on delete: Cascade)
UserIdTextNo—
UserNameText (max 200)No—

RequestAssignments ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
AssignedAtTimestamp (UTC)Yesdefault now()
RequestIdUUIDYesFK → Requests (on delete: Cascade)
UserIdText (max 450)YesFK → AspNetUsers (on delete: Cascade)

Composite indexes: (RequestId, UserId, IX_RequestAssignments_ReqUser)

RequestDepartments ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
AssignedAtTimestamp (UTC)Yesdefault now()
DepartmentIdUUIDYesFK → Departments (on delete: Cascade)
RequestIdUUIDYesFK → Requests (on delete: Cascade)

Composite indexes: (RequestId, DepartmentId, IX_RequestDepartments_ReqDept)

RequestApprovals ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
ClaimedAtTimestamp (UTC)No—
ClaimedByUserIdText (max 450)NoAdvisory claim, in the spirit of a GitHub review assignment: any approver in scope may decide, but claiming signals to the rest of the pool that someone has it
ClaimedByUserNameText (max 200)No—
DecidedAtTimestamp (UTC)No—
DecidedByUserIdText (max 450)No—
DecidedByUserNameText (max 200)No—
DecisionCommentText (max 2000)No—
EmailPipelineIdUUIDNo—
OrganisationIdUUIDYesFK → Organisations (on delete: Cascade)
OutcomeText (max 50)Yes—
PreviousStatusText (max 30)YesStatus the request held at submission, restored when the approval is rejected or cancelled
RequestIdUUIDYesFK → Requests (on delete: Cascade)
RequestedAtTimestamp (UTC)Yesdefault now()
RequestedByUserIdText (max 450)Yes—
RequestedByUserNameText (max 200)Yes—
StatusText (max 20)Yes—
SubjectText (max 500)No—
SubmissionNoteText (max 2000)No—
UserMailConnectionIdUUIDNo—

Composite indexes: (RequestId, UX_RequestApprovals_RequestPending), (OrganisationId, Status, IX_RequestApprovals_OrgStatus), (RequestId, RequestedAt, IX_RequestApprovals_RequestRequestedAt)

RequestBlockers ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
BlockedOnDepartmentIdUUIDNoFK → Departments (on delete: SetNull); Department whose input the request is stalled on (third-party performance alerts)
DescriptionText (max 2000)Yes—
EscalatedAtTimestamp (UTC)NoSet by the deadline hosted service when the blocker overruns; doubles as escalation-email dedup
ExpectedResolutionDateTimestamp (UTC)NoWhen the raiser expects the blocker to clear; escalation fires once this passes
OrganisationIdUUIDYes—
RaisedAtTimestamp (UTC)Yesdefault now()
RaisedByUserIdText (max 450)Yes—
RaisedByUserNameText (max 200)No—
RequestIdUUIDYesFK → Requests (on delete: Cascade)
ResolutionNoteText (max 2000)No—
ResolvedAtTimestamp (UTC)No—
ResolvedByUserIdText (max 450)No—
ResolvedByUserNameText (max 200)No—
TypeText (max 30)Yes—

Composite indexes: (RequestId, IX_RequestBlockers_Request), (OrganisationId, ResolvedAt, IX_RequestBlockers_OrgResolved)

RequestMilestones ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
CompletedAtTimestamp (UTC)No—
CompletedByUserIdText (max 450)No—
CompletedByUserNameText (max 200)No—
CreatedAtTimestamp (UTC)Yesdefault now()
DaysBeforeDeadlineIntegerYesKept so due dates can be recomputed when the deadline moves (extension / clock restart)
DueDateTimestamp (UTC)Yes—
MissedNotifiedAtTimestamp (UTC)NoWhen the missed-milestone alert went out; dedup for the tripwire email
NameText (max 200)Yes—
NameCyText (max 200)No—
OrganisationIdUUIDYes—
RequestIdUUIDYesFK → Requests (on delete: Cascade)
SortOrderIntegerYes—
TemplateIdIntegerNoTemplate this was materialised from; null for ad-hoc milestones

Composite indexes: (RequestId, IX_RequestMilestones_Request), (OrganisationId, DueDate, IX_RequestMilestones_OrgDueIncomplete)

RequestMilestoneDependencies ​

ColumnTypeRequiredNotes
MilestoneIdUUIDYesPK; FK → RequestMilestones (on delete: Cascade); The dependent — the milestone that is held up
DependsOnMilestoneIdUUIDYesPK; FK → RequestMilestones (on delete: Cascade); The predecessor — the milestone that must be completed first
OrganisationIdUUIDYes—

Composite indexes: (DependsOnMilestoneId, IX_RequestMilestoneDependencies_DependsOn)

RequestCostActivities ​

ColumnTypeRequiredNotes
IdUUIDYesPK
CreatedAtTimestamp (UTC)Yes—
CreatedByUserIdTextNo—
CreatedByUserNameTextNo—
DescriptionTextNo—
HoursDecimalYesEstimated or actual staff hours spent
OrganisationIdUUIDYes—
RequestIdUUIDYesFK → Requests (on delete: Cascade)
TypeTextYes—

Composite indexes: (OrganisationId, RequestId)

RequestRefusals ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
CreatedAtTimestamp (UTC)Yesdefault now()
CreatedByUserIdText (max 450)Yes—
CreatedByUserNameText (max 200)Yes—
OrganisationIdUUIDYesFK → Organisations (on delete: Cascade)
PartialDisclosureBooleanYes—
RefusalBasisText (max 4000)No—
RequestIdUUIDYesFK → Requests (on delete: Cascade)

RequestRefusalExemptions ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
ExemptionIdUUIDNoFK → Exemptions (on delete: SetNull); The library entry relied on, or null once that entry has been deleted
IsAbsoluteBooleanYes—
NameText (max 200)Yes—
NameCyText (max 200)No—
RequestRefusalIdUUIDYesFK → RequestRefusals (on delete: Cascade)
RequestTypeIdIntegerYes—
SectionRefText (max 20)No—
SortOrderIntegerYes—

Composite indexes: (RequestRefusalId, ExemptionId, IX_RequestRefusalExemptions_RefExempt)

SubRequests ​

ColumnTypeRequiredNotes
IdUUIDYesPK
AssignedToUserIdTextNo—
AssignedToUserNameTextNo—
CompletedAtTimestamp (UTC)No—
CompletedByUserIdTextNo—
CompletedByUserNameTextNo—
CompletionNoteTextNo—
CreatedAtTimestamp (UTC)Yes—
CreatedByUserIdTextNo—
CreatedByUserNameTextNo—
DepartmentIdUUIDNoFK → Departments (on delete: SetNull); Department responsible for this part of the request
DescriptionTextNo—
DueDateTimestamp (UTC)NoInternal due date; independent of the parent's statutory deadline
OrganisationIdUUIDYes—
RequestIdUUIDYesFK → Requests (on delete: Cascade)
TitleText (max 300)Yes—

Composite indexes: (OrganisationId, RequestId)

RelatedRequests ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
CreatedAtTimestamp (UTC)Yesdefault now()
CreatedByUserIdTextNo—
CreatedByUserNameTextNo—
NoteText (max 1000)NoWhy these two are linked, in the officer's own words
OrganisationIdUUIDYes—
RelatedRequestIdUUIDYesFK → Requests (on delete: Cascade); The higher of the two ids
RelationTypeText (max 20)YesSee RelatedRequestType
RequestIdUUIDYesFK → Requests (on delete: Cascade); The lower of the two ids

Composite indexes: (OrganisationId, RelatedRequestId, IX_RelatedRequests_OrgRelated), (RequestId, RelatedRequestId, IX_RelatedRequests_Pair)

InternalReviews ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
ConcludedAtTimestamp (UTC)No—
ConcludedByUserIdText (max 450)No—
ConcludedByUserNameText (max 200)No—
DueAtTimestamp (UTC)YesWhen the review itself is due — its own clock, not the case's
OrganisationIdUUIDYesFK → Organisations (on delete: Cascade)
OutcomeText (max 30)No—
OutcomeNotesText (max 4000)No—
PreviousStatusText (max 30)YesThe status the case held when the review started, restored when the original decision stands
RequestIdUUIDYesFK → Requests (on delete: Cascade)
RequestedAtTimestamp (UTC)Yesdefault now()
RequestedByUserIdText (max 450)YesThe officer who logged the review, not the requester who asked for it
RequestedByUserNameText (max 200)Yes—
RequesterReasonText (max 4000)NoWhy the requester is unhappy, in their terms
StatusText (max 20)Yes—

Composite indexes: (RequestId, UX_InternalReviews_RequestOpen), (OrganisationId, Status, IX_InternalReviews_OrgStatus), (RequestId, RequestedAt, IX_InternalReviews_RequestRequestedAt)

InternalReviewPreviousHandlers ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
InternalReviewIdUUIDYesFK → InternalReviews (on delete: Cascade)
UserIdText (max 450)Yes—
UserNameText (max 200)Yes—

Composite indexes: (InternalReviewId, IX_InternalReviewPreviousHandlers_ReviewId)

ResponseDraftFiles ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
BlobUrlText (max 500)Yes—
ComplaintStageIntegerNo—
DeletedAtTimestamp (UTC)NoWhen the file was soft-deleted; drives permanent cleanup after the grace period
FileNameText (max 255)Yes—
FileSizeBytesInteger (64-bit)Yes—
IsDeletedBooleanYes—
MimeTypeText (max 100)Yes—
OrganisationIdUUIDYes—
PdfTemplateIdUUIDNoFK → PdfTemplates (on delete: SetNull); The template this file was generated from, if any
PdfTemplateNameText (max 200)NoTemplate name at the point of generation
RedactedAtTimestamp (UTC)No—
RedactedBlobUrlText (max 500)NoBlob of the redacted copy served to the public
RedactedByUserIdTextNo—
RedactedFileSizeBytesInteger (64-bit)No—
RequestIdUUIDYesFK → Requests (on delete: Cascade)
TemplateInputsJsonTextNoThe officer's input values as JSON, keyed the same way the template's fill fields are:
UploadedAtTimestamp (UTC)Yesdefault now()
UploadedByUserIdTextNo—

Composite indexes: (OrganisationId, PdfTemplateId, IX_ResponseDraftFiles_OrgTemplate)

RequestEmbeddings ​

ColumnTypeRequiredNotes
RequestIdUUIDYesPK
ContentHashTextYesSHA-256 of the indexed content — used to skip re-indexing unchanged requests
Embeddingvector(3072)Yes3072-dimensional embedding produced by Gemini gemini-embedding-exp-03-07
IndexedAtTimestamp (UTC)Yes—
OrganisationIdUUIDYes—

Requesters and identity ​

RequesterFlags ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
CreatedAtTimestamp (UTC)Yesdefault now()
IsVexatiousBooleanYes—
NormalizedEmailText (max 254)YesLowercased, trimmed email used as a stable lookup key
NotesText (max 4000)No—
OrganisationIdUUIDYesFK → Organisations (on delete: Cascade)
UpdatedAtTimestamp (UTC)No—
VexatiousFlaggedAtTimestamp (UTC)No—
VexatiousFlaggedByUserIdText (max 450)No—
VexatiousReasonText (max 2000)No—

Composite indexes: (OrganisationId, NormalizedEmail, IX_RequesterFlags_OrgEmail)

IdentityDocuments ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
BlobUrlText (max 500)Yes—
FileNameText (max 255)Yes—
FileSizeBytesInteger (64-bit)Yes—
MimeTypeText (max 100)Yes—
OrganisationIdUUIDYes—
RequestIdUUIDYesFK → Requests (on delete: Cascade)
UploadedAtTimestamp (UTC)Yesdefault now()

Documents and redaction ​

FileRedactions ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
CreatedAtTimestamp (UTC)Yesdefault now()
CreatedByUserIdText (max 450)No—
CreatedByUserNameText (max 200)No—
ExemptionIdUUIDNoFK → Exemptions (on delete: SetNull); The exemption relied on
ExemptionNameText (max 200)No—
ExemptionSectionRefText (max 20)No—
Heightdouble precisionYes—
NoteText (max 2000)NoOptional officer note explaining the specific application of the exemption
OrganisationIdUUIDYes—
PageNumberIntegerYes1-based page number in the original document
RequestIdUUIDYesFK → Requests (on delete: Cascade)
SourceTextYes—
TargetIdUUIDYesResponseDraftFile.Id or MessageAttachment.Id, per TargetKind
TargetKindTextYes—
Widthdouble precisionYes—
Xdouble precisionYes—
Ydouble precisionYes—

Composite indexes: (RequestId, IX_FileRedactions_Request), (OrganisationId, TargetKind, TargetId, IX_FileRedactions_OrgTarget)

DocumentTexts ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
AttemptsIntegerYesHow many times extraction has been attempted
ContentTextNoThe text read out of the file, truncated to MaxContentLength
CreatedAtTimestamp (UTC)Yesdefault now()
ExtractedAtTimestamp (UTC)No—
FailureReasonText (max 500)NoWhy extraction failed, for the file types that were tried and did not work
FileNameText (max 255)Yes—
MimeTypeText (max 200)No—
OrganisationIdUUIDYes—
OwnerIdUUIDYes—
OwnerTypeText (max 40)YesWhich file table OwnerId points into: see DocumentOwnerType
RequestIdUUIDYesFK → Requests (on delete: Cascade); The case the file belongs to
SearchVectortsvectorYesWeighted full-text index over the file name (A) and its contents (B), computed by Postgres from the row
StatusText (max 20)YesSee DocumentTextStatus

Composite indexes: (SearchVector, IX_DocumentTexts_Search), (SearchVector, GIN), (OrganisationId, RequestId, IX_DocumentTexts_OrgRequest), (OwnerType, OwnerId, IX_DocumentTexts_Owner), (Status, CreatedAt, IX_DocumentTexts_Pending)

RedactionSuggestionCaches ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
CreatedAtTimestamp (UTC)Yesdefault now()
HitCountIntegerYes—
LastUsedAtTimestamp (UTC)Yesdefault now(); Bumped on every hit, so cleanup can evict what nobody is reusing
OrganisationIdUUIDYesFK → Organisations (on delete: Cascade)
PayloadHashText (max 64)YesSHA-256 over the document text, the request type, the exemption library, and the prompt version
SuggestionsJsonTextYesSerialised RedactionEntityDto list, stored exactly as it was returned

Composite indexes: (LastUsedAt, IX_RedactionSuggestionCache_LastUsed), (OrganisationId, PayloadHash, IX_RedactionSuggestionCache_OrgHash)

StorageProviders ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
AuthorizationEndpointText (max 500)No—
ClientIdText (max 200)Yes—
ClientSecretText (max 500)No—
ConnectedAccountText (max 254)No—
CreatedAtTimestamp (UTC)Yesdefault now()
DisplayNameText (max 200)Yes—
DriveIdText (max 300)No—
IsEnabledBooleanYes—
KindTextYes—
LastErrorText (max 500)No—
LastVerifiedAtTimestamp (UTC)No—
OrganisationIdUUIDYesFK → Organisations (on delete: Cascade)
RefreshTokenText (max 4000)No—
RootFolderIdText (max 300)No—
RootFolderNameText (max 500)No—
ScopesText (max 1000)No—
SiteUrlText (max 500)No—
StatusText (max 30)Yes—
TenantIdText (max 100)No—
TokenEndpointText (max 500)No—

Composite indexes: (OrganisationId, IX_StorageProviders_Org)

Configuration ​

RequestTypes ​

ColumnTypeRequiredNotes
Id—YesPK
OrganisationIdUUIDYesPK; FK → Organisations (on delete: Cascade)
CanDiscloseBooleanYesWhether requests of this type may be published to the disclosure log
DeadlineSpanintervalYes—
DeletedAtTimestamp (UTC)NoWhen it was retired
DescriptionTextNo—
DescriptionCyTextNo—
InternalReviewDeadlineintervalNoWorking days allowed for an internal review of a request of this type (Ealing RFQ T03)
IsDeletedBooleanYesRetired from the pickers rather than destroyed
LegalHoldReviewDaysIntegerNoDays a legal hold on a request of this type stands before it falls due for review (Ealing RFQ T07)
NameText (max 100)Yes—
NameCyTextNo—
PortalDuplicateCheckEnabledBooleanYesWhether the portal offers matching disclosure log entries before a request of this type is submitted
ReminderDaysTextNo—
RequiresIdentityVerificationBooleanYes—
RetentionDaysIntegerNoNumber of days after closure (or trashing) before a request is permanently deleted
Stage2DeadlineintervalNo—
TypeCodeText (max 5)Yes—

Composite indexes: (OrganisationId, IsDeleted, IX_RequestTypes_OrgLive)

Categories ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
CreatedAtTimestamp (UTC)Yesdefault now()
DescriptionText (max 500)No—
DescriptionCyTextNo—
NameText (max 200)Yes—
NameCyTextNo—
OrganisationIdUUIDYesFK → Organisations (on delete: Cascade)
ParentCategoryIdUUIDNoFK → Categories (on delete: Cascade)
SortOrderIntegerYes—

Composite indexes: (OrganisationId, Name, ParentCategoryId, IX_Categories_OrgNameParent)

CategoryDepartments ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
CategoryIdUUIDYesFK → Categories (on delete: Cascade)
DepartmentIdUUIDYesFK → Departments (on delete: Cascade)

Composite indexes: (CategoryId, DepartmentId, IX_CategoryDepartments_CatDept)

CategoryRequestTypes ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
CategoryIdUUIDYesFK → Categories (on delete: Cascade)
OrganisationIdUUIDYes—
RequestTypeIdIntegerYesFK → RequestTypes (on delete: Cascade)

Composite indexes: (RequestTypeId, OrganisationId), (CategoryId, RequestTypeId, OrganisationId, IX_CategoryRequestTypes_CatRT)

Departments ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
CreatedAtTimestamp (UTC)Yesdefault now()
DeletedAtTimestamp (UTC)NoWhen it was retired
DescriptionText (max 500)No—
IsDeletedBooleanYesRetired rather than destroyed
NameText (max 200)Yes—
OrganisationIdUUIDYesFK → Organisations (on delete: Cascade)

Composite indexes: (OrganisationId, Name, IX_Departments_OrgName)

DepartmentUsers ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
AssignedAtTimestamp (UTC)Yesdefault now()
DepartmentIdUUIDYesFK → Departments (on delete: Cascade)
UserIdText (max 450)YesFK → AspNetUsers (on delete: Cascade)

Composite indexes: (DepartmentId, UserId, IX_DepartmentUsers_DeptUser)

Exemptions ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
CreatedAtTimestamp (UTC)Yesdefault now()
DescriptionText (max 1000)No—
DescriptionCyTextNo—
IsAbsoluteBooleanYes—
NameText (max 200)Yes—
NameCyTextNo—
OrganisationIdUUIDYesFK → Organisations (on delete: Cascade)
RequestTypeIdIntegerYesFK → RequestTypes (on delete: Cascade)
SectionRefText (max 20)No—
SortOrderIntegerYes—

Composite indexes: (RequestTypeId, OrganisationId), (OrganisationId, RequestTypeId, SectionRef, IX_Exemptions_OrgTypeSec)

MilestoneTemplates ​

ColumnTypeRequiredNotes
Id—YesPK
OrganisationIdUUIDYesPK
CreatedAtTimestamp (UTC)Yesdefault now()
DaysBeforeDeadlineIntegerYesBusiness days before the request deadline that this checkpoint falls due
NameText (max 200)Yes—
NameCyText (max 200)No—
RequestTypeIdIntegerYesFK → RequestTypes (on delete: Cascade)
SortOrderIntegerYes—

Composite indexes: (RequestTypeId, OrganisationId)

MilestoneTemplateDependencies ​

ColumnTypeRequiredNotes
TemplateIdIntegerYesPK; FK → MilestoneTemplates (on delete: Cascade); The dependent — the checkpoint that is held up
DependsOnTemplateIdIntegerYesPK; FK → MilestoneTemplates (on delete: Cascade); The predecessor — the checkpoint that must be completed first
OrganisationIdUUIDYesPK

Composite indexes: (DependsOnTemplateId, OrganisationId, IX_MilestoneTemplateDependencies_DependsOn), (TemplateId, OrganisationId)

ResponseTemplates ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
BodyHtmlTextNo—
CreatedAtTimestamp (UTC)Yesdefault now()
IsActiveBooleanYes—
NameText (max 200)Yes—
OrganisationIdUUIDYesFK → Organisations (on delete: Cascade)
UpdatedAtTimestamp (UTC)No—

Composite indexes: (OrganisationId, Name, IX_ResponseTemplates_OrgName)

PdfTemplates ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
BlobUrlTextNoBlob path of the uploaded PDF
BodyHtmlTextNo—
CreatedAtTimestamp (UTC)Yesdefault now()
FieldMappingsJsonTextNoJSON array of AcroForm field mappings: [{ "fieldName", "source", "token", "label", "required" }]
FileNameTextNoOriginal uploaded file name
InputFieldsJsonTextNoJSON array of custom input fields: [{ "token", "label", "required" }]
IsActiveBooleanYes—
KindText (max 10)YesTemplate source: "Html" (rich-text authored) or "Pdf" (uploaded AcroForm PDF)
NameText (max 200)Yes—
OrganisationIdUUIDYesFK → Organisations (on delete: Cascade)
UpdatedAtTimestamp (UTC)No—

Composite indexes: (OrganisationId, Name, IX_PdfTemplates_OrgName)

OrganisationEmailTemplates ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
BodyHtmlTextYes—
CreatedAtTimestamp (UTC)Yesdefault now()
LanguageText (max 10)Yes—
OrganisationIdUUIDYesFK → Organisations (on delete: Cascade)
SubjectText (max 500)Yes—
TemplateTypeText (max 50)Yes—
UpdatedAtTimestamp (UTC)No—

Composite indexes: (OrganisationId, TemplateType, Language, IX_OrgEmailTemplates_OrgTypeLang)

EmailTemplateImages ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
BlobPathText (max 500)Yes—
ContentTypeText (max 100)Yes—
FileSizeBytesInteger (64-bit)Yes—
OrganisationIdUUIDYesFK → Organisations (on delete: Cascade)
UploadedAtTimestamp (UTC)Yesdefault now()
UrlText (max 2000)Yes—

FormSteps ​

ColumnTypeRequiredNotes
Id—YesPK
FormInstructionsTextNo—
LanguageText (max 10)Yes—
OrganisationIdUUIDYes—
PageIntegerYes—
RequestTypeIdIntegerYesFK → RequestTypes (on delete: Cascade)
TitleTextYes—

Composite indexes: (RequestTypeId, OrganisationId)

FormFields ​

ColumnTypeRequiredNotes
Id—YesPK
FormStepIdIntegerYesFK → FormSteps (on delete: Cascade)
FormatTextNo—
IsRequiredBooleanYes—
IsStaffOnlyBooleanYesCase metadata rather than a question for the requester: never rendered on the portal form, never submitted, and set by staff on the case after it arrives
KeyText (max 100)NoThe stable identifier a custom field's value is stored under in FormFieldsData, and the handle every filter and report uses
LabelTextYes—
OrderIntegerYes—
TypeTextYes—

Organisation, users and access control ​

Organisations ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
BillingIntervalText (max 10)Nomonthly or yearly
CreatedAtTimestamp (UTC)Yesdefault now()
IcoRegistrationNumberText (max 20)No—
NameText (max 200)Yes—
OrgTypeText (max 50)Yes—
PostalAddressText (max 500)No—
RequestSequenceIntegerYesLast reference number allocated for RequestSequenceYear
RequestSequenceYearIntegerYesCalendar year RequestSequence belongs to; the sequence restarts each year
StorageLimitBytesInteger (64-bit)Yes1 GB trial default
StripeCustomerIdText (max 50)No—
StripeSubscriptionIdText (max 50)No—
SubscriptionPlanIdIntegerNoFK → SubscriptionPlans (on delete: NoAction)
SubscriptionStatusText (max 20)Yes—
TrialEndsAtTimestamp (UTC)No—

OrganisationSettings ​

ColumnTypeRequiredNotes
OrganisationIdUUIDYesPK
AIEnabledBooleanYes—
BackupIntervalHoursIntegerYesHours between scheduled backups, between MinimumIntervalHours and MaximumIntervalHours
BackupRetentionDaysIntegerYesDays a backup is kept before it is deleted, capped at MaximumDays
BackupScheduleEnabledBooleanYesTake a backup of this organisation automatically, every BackupIntervalHours hours
CaptchaEnabledBooleanYes—
CaptchaSecretKeyTextNo—
CaptchaSiteKeyTextNo—
CostHourlyRatePoundsDecimalYesFlat hourly rate for s.12 cost estimates (Fees Regulations 2004: £25/hour)
CostLimitPoundsDecimalYess.12 FOIA appropriate limit in pounds (£450 for most authorities, £600 for central government)
CustomDomainText (max 200)No—
DefaultLanguageText (max 10)Yes—
DisplayHeaderTextBooleanYes—
DisposalReviewRequiredBooleanYesRequire a person to authorise each disposal before the retention job destroys anything (Ealing RFQ T07)
FooterTextColourTextNo—
HeaderTextColourTextNo—
HomeUrlTextNo—
InboundEmailAddressText (max 200)No—
LastBackupAtTimestamp (UTC)NoWhen the scheduler last completed a backup
LastRetentionRunAtTimestamp (UTC)NoWhen the retention job last ran over this organisation (Ealing RFQ T07)
LegalHoldReviewDaysIntegerYesThe authority's house rule for how often a legal hold is reviewed, in days — see LegalHoldPolicy
LinkColourTextNo—
LogoUrlText (max 500)No—
OfficerNamesInResponseDraftEnabledBooleanYes—
PageTitleText (max 200)No—
PrimaryColourText (max 7)No—
PrivacyNoticeUrlText (max 500)No—
PublicApiKeyAuthEnabledBooleanYesThe public API accepts static API keys (Ealing RFQ T11)
PublicApiOAuthEnabledBooleanYesThe public API accepts OAuth 2.0 client-credentials access tokens
PublicFooterTextText (max 1000)No—
PublicHeaderTextText (max 500)No—
RegionText (max 30)Yes—
RequesterNamesInResponseDraftEnabledBooleanYes—
RequireTwoFactorBooleanYesEvery member of this organisation must have an authenticator app enrolled (Ealing RFQ T02)
ResponseApprovalRequiredBooleanYesWhen enabled, a response cannot be sent directly — it must be submitted for approval and signed off by a user with the ApproveResponse permission
SecondaryColourText (max 7)No—
SubdomainSlugText (max 50)Yesunique
UseGovUkThemeBooleanYes—
WelshEnabledBooleanYes—

OrganisationBrandingTranslations ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
LanguageText (max 10)Yes—
OrganisationIdUUIDYesFK → Organisations (on delete: Cascade)
PageTitleText (max 200)No—
PublicFooterTextText (max 1000)No—
PublicHeaderTextText (max 500)No—

Composite indexes: (OrganisationId, Language, IX_OrgBrandingTranslations_OrgLang)

OrganisationRoles ​

ColumnTypeRequiredNotes
Id—YesPK
ApplicationRoleTextYes—
OrganisationIdUUIDYesFK → Organisations (on delete: Cascade)
RoleNameTextYes—

OrganisationUserRoles ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
AssignedAtTimestamp (UTC)Yesdefault now()
IsActiveBooleanYes—
IsRevokedBooleanYes—
OrganisationIdUUIDYesFK → Organisations (on delete: Cascade)
RoleIdIntegerYesFK → OrganisationRoles (on delete: Cascade)
UserIdText (max 450)YesFK → AspNetUsers (on delete: Cascade)

Composite indexes: (UserId, OrganisationId, IX_OrgUserRoles_UserOrgRole)

OrgInvitations ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
AcceptedAtTimestamp (UTC)No—
CreatedAtTimestamp (UTC)Yesdefault now()
DepartmentIdUUIDNo—
EmailText (max 254)Yes—
ExpiresAtTimestamp (UTC)Yes—
InvitedByUserIdText (max 450)Yes—
IsAcceptedBooleanYes—
OrganisationIdUUIDYesFK → Organisations (on delete: Cascade)
RoleIdIntegerYesFK → OrganisationRoles (on delete: Cascade)
TokenText (max 100)Yes—

Composite indexes: (Token, IX_OrgInvitations_Token), (OrganisationId, Email, IX_OrgInvitations_OrgEmail)

SsoConfigurations ​

ColumnTypeRequiredNotes
OrganisationIdUUIDYesPK
AuthorityText (max 500)No—
ClientIdText (max 200)No—
ClientSecretText (max 500)No—
DisplayNameText (max 100)No—
EnabledBooleanYes—
RequireSsoBooleanYesRefuses password sign-in for every member of this organisation, leaving the identity provider as the only way in
ScopesText (max 500)Yes—

DomainVerifications ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
CloudflareHostnameIdText (max 100)Yes—
CreatedAtTimestamp (UTC)Yesdefault now()
DomainText (max 200)Yes—
OrganisationIdUUIDYesFK → Organisations (on delete: Cascade)
OwnershipVerificationNameText (max 300)No—
OwnershipVerificationValueText (max 500)No—
SslStatusText (max 50)No—
StatusTextYes—
VerifiedAtTimestamp (UTC)No—

Composite indexes: (OrganisationId, Domain)

AspNetUsers ​

ColumnTypeRequiredNotes
IdTextNoPK
AccessFailedCountIntegerYes—
ConcurrencyStampTextNo—
CreatedAtTimestamp (UTC)Yesdefault now()
EmailText (max 256)No—
EmailConfirmedBooleanYes—
FirstNameTextNo—
LastLoginAtTimestamp (UTC)No—
LastNameTextNo—
LockoutEnabledBooleanYes—
LockoutEndTimestamp (UTC)No—
NormalizedEmailText (max 256)No—
NormalizedUserNameText (max 256)No—
PasswordHashTextNo—
PhoneNumberTextNo—
PhoneNumberConfirmedBooleanYes—
PreferredLanguageText (max 10)Yes—
SecurityStampTextNo—
TwoFactorEnabledBooleanYes—
UserNameText (max 256)No—

Composite indexes: (NormalizedEmail, EmailIndex), (NormalizedUserName, UserNameIndex)

AspNetRoles ​

ColumnTypeRequiredNotes
IdTextNoPK
ConcurrencyStampTextNo—
NameText (max 256)No—
NormalizedNameText (max 256)No—

Composite indexes: (NormalizedName, RoleNameIndex)

AspNetUserRoles ​

ColumnTypeRequiredNotes
UserIdTextNoPK
RoleIdTextNoPK

AspNetUserClaims ​

ColumnTypeRequiredNotes
Id—YesPK
ClaimTypeTextNo—
ClaimValueTextNo—
UserIdTextYes—

AspNetRoleClaims ​

ColumnTypeRequiredNotes
Id—YesPK
ClaimTypeTextNo—
ClaimValueTextNo—
RoleIdTextYes—

AspNetUserLogins ​

ColumnTypeRequiredNotes
LoginProviderTextNoPK
ProviderKeyTextNoPK
ProviderDisplayNameTextNo—
UserIdTextYes—

AspNetUserTokens ​

ColumnTypeRequiredNotes
UserIdTextNoPK
LoginProviderTextNoPK
NameTextNoPK
ValueTextNo—

Audit trails ​

AdminAuditLogs ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
CreatedAtTimestamp (UTC)Yesdefault now()
DescriptionText (max 1000)Yes—
EntityIdText (max 100)No—
EntityTypeText (max 50)YesCategory, Department, Exemption, Template, RequestType, EmailPipeline, Role, User, Organisation, Sso
EventTypeText (max 50)YesCreated, Updated, Deleted, Deactivated, Reactivated, Invited, Removed, RoleChanged, etc
OrganisationIdUUIDYesFK → Organisations (on delete: Cascade)
UserIdText (max 450)Yes—
UserNameText (max 200)Yes—

Composite indexes: (OrganisationId, CreatedAt, IX_AdminAuditLogs_OrgCreated), (UserId, CreatedAt, IX_AdminAuditLogs_UserCreated)

UserAccessLogs ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
CreatedAtTimestamp (UTC)Yesdefault now()
EmailText (max 254)No—
EventTypeText (max 50)YesWhat happened
FailureReasonText (max 500)No—
IpAddressText (max 45)No—
OrganisationIdUUIDYesFK → Organisations (on delete: Cascade)
UserAgentText (max 500)No—
UserIdTextNo—
UserNameText (max 200)No—

Composite indexes: (OrganisationId, CreatedAt, IX_UserAccessLogs_OrgCreated), (UserId, CreatedAt, IX_UserAccessLogs_UserCreated)

RecordAccessLogs ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
AccessTypeText (max 20)YesWhat was done: see RecordAccessType
CreatedAtTimestamp (UTC)Yesdefault now()
DescriptionText (max 500)NoHuman-readable subject — the file name, the report name, the case reference
EntityIdText (max 100)NoIdentifier of the thing itself — a file id, a report key
EntityTypeText (max 50)YesWhat kind of thing was reached: see RecordAccessEntity
IpAddressText (max 64)No—
OrganisationIdUUIDYesFK → Organisations (on delete: Cascade)
RequestIdUUIDNoThe case the access concerned, where there is one
UserAgentText (max 512)No—
UserIdText (max 450)No—
UserNameText (max 200)No—

Composite indexes: (OrganisationId, CreatedAt, IX_RecordAccessLogs_OrgCreated), (RequestId, CreatedAt, IX_RecordAccessLogs_RequestCreated), (OrganisationId, UserId, CreatedAt, IX_RecordAccessLogs_OrgUserCreated), (OrganisationId, UserId, EntityType, EntityId, CreatedAt, IX_RecordAccessLogs_Dedup)

EmailLogs ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
BodyHtmlTextNo—
CreatedAtTimestamp (UTC)Yesdefault now()
DirectionText (max 10)Yes—
EmailTypeText (max 50)No—
ErrorMessageText (max 2000)No—
FromAddressText (max 254)No—
OrganisationIdUUIDYes—
PipelineIdUUIDNoFK → EmailPipelines (on delete: SetNull)
RequestIdUUIDNoFK → Requests (on delete: NoAction)
RequestMessageIdUUIDNo—
SentAtTimestamp (UTC)No—
StatusText (max 20)No—
SubjectText (max 500)No—
ToAddressText (max 254)No—
UserMailConnectionIdUUIDNoSet when the email was sent via a user's personal mail connection

Public portal ​

Portals ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
CreatedAtTimestamp (UTC)Yesdefault now()
IsDefaultBooleanYesWhen true this portal is served for URLs that name no portal
IsEnabledBooleanYesA disabled portal is not served publicly, so a link can be withdrawn without deleting it
NameText (max 100)Yes—
OrganisationIdUUIDYesFK → Organisations (on delete: Cascade)
SlugText (max 60)YesURL-safe identifier, unique within the organisation

Composite indexes: (OrganisationId, IX_Portals_OrgDefault), (OrganisationId, Slug, IX_Portals_OrgSlug)

PortalRequestTypes ​

ColumnTypeRequiredNotes
PortalIdUUIDYesPK; FK → Portals (on delete: Cascade)
RequestTypeIdIntegerYesPK; FK → RequestTypes (on delete: Cascade)
OrganisationIdUUIDYes—

Composite indexes: (RequestTypeId, OrganisationId)

StatusSubscribers ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
ConfirmTokenText (max 128)No—
CreatedAtTimestamp (UTC)Yesdefault now()
EmailText (max 256)Yes—
IsConfirmedBooleanYes—
UnsubscribeTokenText (max 128)No—

Composite indexes: (Email, IX_StatusSubscribers_Email)

Reporting and dashboards ​

ReportDefinitions ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
BuiltInKeyText (max 50)NoWhich built-in report this row offers — one of All
CreatedAtTimestamp (UTC)Yesdefault now()
CreatedByUserIdTextNo—
DefinitionJSONNoThe custom query, as JSON (ReportQuery)
DescriptionText (max 500)No—
KindText (max 20)YesSee ReportDefinitionKind
NameText (max 100)Yes—
OrganisationIdUUIDYesFK → Organisations (on delete: Cascade)
SortOrderIntegerYesOrder in the reports tab
SystemKeyText (max 50)NoSet on the reports scaffolded with the organisation, so scaffolding twice cannot produce duplicates
UpdatedAtTimestamp (UTC)No—

Composite indexes: (OrganisationId, SortOrder, IX_ReportDefinitions_OrgOrder), (OrganisationId, SystemKey, IX_ReportDefinitions_OrgSystemKey)

ReportDefinitionRoles ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
ReportDefinitionIdUUIDYesFK → ReportDefinitions (on delete: Cascade)
RoleIdIntegerYesFK → OrganisationRoles (on delete: Cascade)

Composite indexes: (ReportDefinitionId, RoleId, IX_ReportDefinitionRoles_Pair)

ReportSchedules ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
CreatedAtTimestamp (UTC)Yesdefault now()
CreatedByUserIdTextNo—
DayOfMonthIntegerNoDay of the month for a monthly schedule, 1–28
DayOfWeekIntegerNoDay of the week for a weekly schedule, DayOfWeek as an int (0 = Sunday)
EnabledBooleanYesOff by default and off after any change that could not be validated
FrequencyText (max 20)YesOne of ReportScheduleFrequency
HourLocalIntegerYesWall-clock hour, 0–23, in the notification time zone
LastRunAtTimestamp (UTC)NoWhen the sweep last sent this schedule
LastRunNoteText (max 500)NoWhy the last run sent less than it should have, or nothing at all
LastRunRecipientCountIntegerNoNumber of recipients the last run actually reached
MinuteLocalIntegerYesWall-clock minute, 0–59
OrganisationIdUUIDYesFK → Organisations (on delete: Cascade)
ReportDefinitionIdUUIDYesFK → ReportDefinitions (on delete: Cascade)
UpdatedAtTimestamp (UTC)No—

Composite indexes: (ReportDefinitionId, IX_ReportSchedules_Definition), (OrganisationId, Enabled, IX_ReportSchedules_OrgEnabled)

ReportScheduleRecipients ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
ReportScheduleIdUUIDYesFK → ReportSchedules (on delete: Cascade)
UserIdText (max 450)Yes—

Composite indexes: (ReportScheduleId, UserId, IX_ReportScheduleRecipients_Pair)

Dashboards ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
CreatedAtTimestamp (UTC)Yesdefault now()
CreatedByUserIdTextNo—
DescriptionText (max 500)NoShown under the name in the picker
NameText (max 100)Yes—
OrganisationIdUUIDYesFK → Organisations (on delete: Cascade)
SortOrderIntegerYesOrder in the sidebar
SystemKeyText (max 50)NoSet on the dashboard scaffolded with the organisation (see SystemContent), which is the one users landed on before any of this existed
UpdatedAtTimestamp (UTC)No—

Composite indexes: (OrganisationId, SortOrder, IX_Dashboards_OrgOrder), (OrganisationId, SystemKey, IX_Dashboards_OrgSystemKey)

DashboardWidgets ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
ColumnIntegerYes—
DashboardIdUUIDYesFK → Dashboards (on delete: Cascade)
HeightIntegerYes—
RowIntegerYes—
SettingsJSONNoWidget-specific configuration as JSON — which saved report a report.embed panel runs, and whatever later widgets need
TitleText (max 100)NoReplaces the widget's default heading
WidgetKeyText (max 60)YesOne of All
WidthIntegerYes—

Composite indexes: (DashboardId, Row, Column, IX_DashboardWidgets_Position)

DashboardRoles ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
DashboardIdUUIDYesFK → Dashboards (on delete: Cascade)
RoleIdIntegerYesFK → OrganisationRoles (on delete: Cascade)

Composite indexes: (DashboardId, RoleId, IX_DashboardRoles_Pair)

Retention, backup and erasure ​

DisposalReviews ​

ColumnTypeRequiredNotes
IdUUIDYesPK
DateReceivedTimestamp (UTC)Yes—
DecidedAtTimestamp (UTC)No—
DecidedByUserIdTextNo—
DecidedByUserNameText (max 200)No—
DecisionNotesText (max 1000)No—
DestroyedAtTimestamp (UTC)NoWhen the case was actually destroyed
EligibilityReasonText (max 20)Yes—
EligibleFromTimestamp (UTC)YesThe date the case became eligible — the response date or the trashing date plus the retention period
OrganisationIdUUIDYesFK → Organisations (on delete: Cascade)
ProposalReasonText (max 1000)No—
ProposedAtTimestamp (UTC)YesWhen the retention job raised this proposal
ProposedByUserIdTextNoWho put this case forward, where a person did
ProposedByUserNameText (max 200)No—
ReferenceNumberText (max 50)Yes—
RequestIdUUIDYesThe case this proposal is about
RequestTypeNameText (max 200)No—
RetainUntilTimestamp (UTC)NoFor a retained case: the date it may be proposed again
RetentionDaysIntegerYesThe retention period, in days, that made this case eligible
StatusTextYes—
TitleText (max 500)No—

Composite indexes: (OrganisationId, Status, IX_DisposalReviews_OrganisationStatus), (RequestId, Status, IX_DisposalReviews_RequestStatus)

OrganisationBackups ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
BlobPathText (max 500)YesPath within the backups container
CreatedAtTimestamp (UTC)Yes—
CreatedByNameText (max 200)No—
CreatedByUserIdTextNoNull on a scheduled backup — nobody pressed anything
ExpiresAtTimestamp (UTC)YesWhen this backup is deleted, archive and all
OrganisationIdUUIDYesFK → Organisations (on delete: Cascade)
RowCountIntegerYesRows across every table, for the listing
SchemaVersionText (max 20)YesFormat of the archive
SizeBytesInteger (64-bit)Yes—
TableCountsJsonTextNoRow count per table, as JSON, so the listing can show what a backup holds
TriggerText (max 20)YesOne of BackupTrigger

Composite indexes: (OrganisationId, CreatedAt)

OrganisationErasures ​

ColumnTypeRequiredNotes
IdUUIDYesPK
CancelledAtTimestamp (UTC)No—
CancelledByNameText (max 512)No—
CancelledByUserIdTextNo—
CompletedAtTimestamp (UTC)No—
FailureMessageTextNoWhy an erasure that became due did not finish
FilesDeletedIntegerYesStored files destroyed — documents, attachments, backups, export archives, logos
FilesFailedIntegerYesFiles the erasure could not remove from storage, if any
ForeignReferencesRemovedIntegerYesCase-assignment links another organisation still held against an account this erasure deleted, and which could not outlive it
ManifestJSONNoPer-table row counts as JSON, in the order the tables were cleared
OrganisationIdUUIDYesThe organisation this concerns
OrganisationNameText (max 512)YesThe organisation's name as it stood when erasure was scheduled
ReasonTextNoWhy the authority is leaving, if they said
ReferenceText (max 32)Yesunique; Human-quotable identifier for the certificate, unique across the platform — the reference an authority puts in its own exit records and quotes back if it ever needs to
RequestedAtTimestamp (UTC)Yes—
RequestedByEmailTextNo—
RequestedByNameText (max 512)YesName and email of the person who asked, copied at the time
RequestedByUserIdTextYes—
RowsDeletedIntegerYesDatabase rows destroyed, across every table
ScheduledForTimestamp (UTC)YesThe instant erasure becomes due — RequestedAt plus GraceDays
StatusTextYes—
UsersDeletedIntegerYesSign-in accounts destroyed: the people whose only membership was of this organisation

Composite indexes: (OrganisationId, UX_OrganisationErasures_Scheduled), (Status, ScheduledFor, IX_OrganisationErasures_StatusScheduledFor)

DataPortabilityJobs ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
BackupIdUUIDNoThe restore point a backup job produced
BlobPathText (max 500)NoPath within the exports container
CompletedAtTimestamp (UTC)No—
CreatedAtTimestamp (UTC)Yes—
ErrorTextNoWhy it failed, in terms the person who asked can act on
ExpiresAtTimestamp (UTC)NoWhen the produced archive is deleted
FormatText (max 10)NoCSV, JSON or XML
IncludeFilesBooleanYes—
KindText (max 20)YesOne of DataJobKind
OrganisationIdUUIDYesFK → Organisations (on delete: Cascade)
RequestedByNameText (max 200)No—
RequestedByUserIdTextNo—
RowCountIntegerYes—
SizeBytesInteger (64-bit)Yes—
StartedAtTimestamp (UTC)No—
StatusText (max 20)YesOne of DataJobStatus
TablesJsonTextNoChosen tables as JSON, or null for all of them

Composite indexes: (OrganisationId, CreatedAt), (Status, CreatedAt)

Integration and API ​

ApiTokens ​

ColumnTypeRequiredNotes
IdUUIDYesPK
CreatedAtTimestamp (UTC)Yes—
CreatedByUserIdTextNo—
CreatedByUserNameTextNo—
ExpiresAtTimestamp (UTC)No—
LastUsedAtTimestamp (UTC)No—
NameText (max 100)Yes—
OrganisationIdUUIDYesFK → Organisations (on delete: Cascade)
PrefixText (max 16)YesFirst characters of the token (e.g. "rvk_a1b2c3") for display/identification
RevokedAtTimestamp (UTC)No—
TokenHashText (max 64)Yesunique; SHA-256 hex hash of the full token value

ApiOAuthClients ​

ColumnTypeRequiredNotes
IdUUIDYesPK
ClientIdText (max 64)Yesunique; The public identifier, quoted in configuration and safe to display
ClientSecretHashText (max 64)YesSHA-256 hex hash of the client secret
CreatedAtTimestamp (UTC)Yes—
CreatedByUserIdTextNo—
CreatedByUserNameTextNo—
LastUsedAtTimestamp (UTC)No—
NameText (max 100)Yes—
OrganisationIdUUIDYesFK → Organisations (on delete: Cascade)
RevokedAtTimestamp (UTC)No—

ApiAccessTokens ​

ColumnTypeRequiredNotes
IdUUIDYesPK
ApiOAuthClientIdUUIDYesFK → ApiOAuthClients (on delete: Cascade)
ExpiresAtTimestamp (UTC)Yes—
IssuedAtTimestamp (UTC)Yes—
OrganisationIdUUIDYes—
TokenHashText (max 64)Yesunique

WebhookSubscriptions ​

ColumnTypeRequiredNotes
IdUUIDYesPK
ConsecutiveFailuresIntegerYesConsecutive delivery failures; the subscription is auto-disabled once this passes a threshold
CreatedAtTimestamp (UTC)Yes—
CreatedByUserIdTextNo—
CreatedByUserNameTextNo—
EventsText (max 500)YesComma-separated event names ("request.created,request.closed,request.overdue") or "*" for all
FormatTextYesThe body shape this endpoint receives
IsActiveBooleanYes—
LastErrorTextNo—
LastTriggeredAtTimestamp (UTC)No—
OrganisationIdUUIDYesFK → Organisations (on delete: Cascade)
SecretText (max 128)YesHMAC signing secret; shown once at creation
UrlText (max 2000)Yes—

EmailPipelines ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
AuthModeTextYesHow this pipeline authenticates to the mail server:
ConsecutiveFailuresIntegerYesNumber of consecutive IMAP connection/auth failures
CreatedAtTimestamp (UTC)Yesdefault now()
FromAddressText (max 254)Yes—
FromDisplayNameText (max 200)No—
ImapHostText (max 200)No—
ImapPasswordText (max 500)No—
ImapPortIntegerYesIMAP port, typically 993 (SSL/TLS)
ImapUseTlsBooleanYesUse SSL/TLS when connecting to IMAP
ImapUsernameText (max 200)No—
InboundAddressText (max 254)Yes—
IsDefaultBooleanYesWhen multiple pipelines serve the same request type, this one is used for outbound email on requests that have no pipeline of their own (e.g. created via the public portal)
IsEnabledBooleanYesWhether this pipeline is active
LastPolledAtTimestamp (UTC)NoTimestamp of the last successful poll
LastProcessedUidInteger (64-bit)YesUID of the last successfully processed email in the IMAP mailbox
NameText (max 200)Yes—
OAuthConnectedEmailText (max 254)No—
OAuthProviderIdUUIDNoFK → MailOAuthProviders (on delete: SetNull); Org OAuth provider used when AuthMode = OAuth
OAuthRefreshTokenText (max 4000)No—
OrganisationIdUUIDYesFK → Organisations (on delete: Cascade)
PollingErrorText (max 500)No—
PollingErrorAtTimestamp (UTC)NoTimestamp when the polling error was recorded
PollingLockHolderText (max 100)No—
PollingLockUntilTimestamp (UTC)NoWhen the current polling lock expires
ReplyToAddressText (max 254)No—
RequestTypeIdIntegerYesFK → RequestTypes (on delete: Cascade); Request type this pipeline routes inbound mail to
SmtpHostText (max 200)Yes—
SmtpPasswordText (max 500)No—
SmtpPortIntegerYesSMTP port, typically 587 (STARTTLS) or 465 (SSL)
SmtpUsernameText (max 200)Yes—
UseTlsBooleanYesUse TLS/SSL when connecting

Composite indexes: (OrganisationId, InboundAddress, IX_EmailPipelines_OrgInbound), (RequestTypeId, OrganisationId)

MailOAuthProviders ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
AuthorizationEndpointText (max 500)No—
ClientIdText (max 200)Yes—
ClientSecretText (max 500)No—
CreatedAtTimestamp (UTC)Yesdefault now()
DisplayNameText (max 200)Yes—
ImapHostText (max 200)No—
ImapPortIntegerNo—
IsEnabledBooleanYes—
KindTextYes—
OrganisationIdUUIDYesFK → Organisations (on delete: Cascade)
ScopesText (max 1000)No—
SmtpHostText (max 200)No—
SmtpPortIntegerNo—
TenantIdText (max 100)No—
TokenEndpointText (max 500)No—

Composite indexes: (OrganisationId, IX_MailOAuthProviders_Org)

UserMailConnections ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
AuthTypeTextYes—
CreatedAtTimestamp (UTC)Yesdefault now()
DisplayNameText (max 200)No—
EmailAddressText (max 254)Yes—
LastErrorText (max 500)No—
LastVerifiedAtTimestamp (UTC)No—
OrganisationIdUUIDYesFK → Organisations (on delete: Cascade)
ProviderIdUUIDNoFK → MailOAuthProviders (on delete: SetNull)
RefreshTokenText (max 4000)No—
SmtpHostText (max 200)No—
SmtpPasswordText (max 500)No—
SmtpPortIntegerYes—
SmtpUsernameText (max 200)No—
StatusText (max 30)Yes—
UseTlsBooleanYes—
UserIdText (max 450)YesFK → AspNetUsers (on delete: Cascade)

Composite indexes: (OrganisationId, UserId, IX_UserMailConnections_OrgUser)

Subscription and billing ​

SubscriptionPlans ​

ColumnTypeRequiredNotes
Id—YesPK
AiInputTokenLimitPerMonthIntegerYesMonthly limit on AI generation input tokens (0 = unlimited)
AiOutputTokenLimitPerMonthIntegerYesMonthly limit on AI generation output tokens (0 = unlimited)
DeletedAtTimestamp (UTC)No—
DescriptionText (max 500)Yes—
IsDeletedBooleanYes—
MonthlyPricePenceIntegerYes—
NameText (max 100)Yes—
OrderIntegerYes—
RequestLimitPerMonthIntegerYes—
StorageLimitBytesInteger (64-bit)Yes50 GB
StripeMonthlyPriceIdText (max 100)Yes—
StripeYearlyPriceIdText (max 100)Yes—
TrialDaysIntegerYes—
YearlyPricePenceIntegerYes—

Invoices ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
AmountDueIntegerYesin pence
AmountPaidIntegerYesin pence
CreatedAtTimestamp (UTC)Yesdefault now()
CurrencyText (max 5)Yes—
DueDateTimestamp (UTC)No—
HostedInvoiceUrlText (max 500)No—
InvoicePdfUrlText (max 500)No—
OrganisationIdUUIDYesFK → Organisations (on delete: Cascade)
PeriodEndText (max 30)No—
PeriodStartText (max 30)No—
StatusText (max 20)Yesdraft, open, paid, void, uncollectible
StripeInvoiceIdText (max 100)Yes—
TaxIntegerYesin pence

Composite indexes: (StripeInvoiceId, IX_Invoices_StripeId), (OrganisationId, CreatedAt, IX_Invoices_OrgCreated)

DpaAcceptances ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
AcceptedAtTimestamp (UTC)Yesdefault now()
DpaVersionText (max 20)Yes—
IpAddressText (max 45)Yes—
OrganisationIdUUIDYesFK → Organisations (on delete: Cascade)
UserIdText (max 450)Yes—

Composite indexes: (OrganisationId, DpaVersion, IX_DpaAcceptances_OrgVersion)

OrgAiTokenUsages ​

ColumnTypeRequiredNotes
OrganisationIdUUIDYesPK; FK → Organisations (on delete: Cascade)
YearMonthDateYesPK; First day of the month this record covers, e.g. 2026-05-01
InputTokensUsedIntegerYes—
OutputTokensUsedIntegerYes—
UpdatedAtTimestamp (UTC)Yes—

Platform ​

BankHolidays ​

ColumnTypeRequiredNotes
Id—YesPK
DateDateYes—
DivisionText (max 30)Yes—
NotesText (max 200)No—
TitleText (max 200)Yes—

Composite indexes: (Division, Date, IX_BankHolidays_DivisionDate)

DistributedLocks ​

ColumnTypeRequiredNotes
NameText (max 100)NoPK
ExpiresAtTimestamp (UTC)NoWhen the lock expires and can be re-acquired by another instance
HolderText (max 200)No—
VersionxidYes—

Incidents ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
AffectedComponentText (max 100)Yes—
CreatedAtTimestamp (UTC)Yesdefault now()
DescriptionText (max 2000)Yes—
ResolvedAtTimestamp (UTC)No—
SeverityTextYes—
StatusTextYes—
TitleText (max 300)Yes—

IncidentUpdates ​

ColumnTypeRequiredNotes
IdUUIDYesPK; default gen_random_uuid()
CreatedAtTimestamp (UTC)Yesdefault now()
IncidentIdUUIDYesFK → Incidents (on delete: Cascade)
MessageText (max 2000)Yes—
StatusTextYes—

Phanera — FOI, SAR, EIR & Complaints management