Refresh HiveGrid Cloud reference snapshot

This commit is contained in:
david committed 2026-08-03 15:31:14 +02:00
1 parent 5e99e14772
commit 7f88026f79
5955 files changed
+1177325 -188362

No files matched your search

@@ -62,6 +62,13 @@ enum FileEntityType {
// VA-P23 · mirrored mailbox message (email-inbox attachments -> Files).
// ADDITIVE cross-module touch of files.prisma, flagged per AD-21.
email_message
// AK-P15b · Team Chat attachment linked through FileEntityLink.
// ADDITIVE cross-module touch of files.prisma, flagged per AD-21.
chat_message
// AK-P21 · in-app feedback attachment (SupportTicket) linked through
// FileEntityLink. ADDITIVE cross-module touch of files.prisma, flagged per
// AD-21.
support_ticket
}
/// A stored file, scoped per tenant. `storageKey` points at the original object
@@ -73,7 +80,10 @@ model File {
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
tenantId String
createdByUserId String
/// Exactly one of createdByUserId / createdByPortalUserId must be non-null.
/// The merge migration adds the database CHECK; shared service helpers enforce
/// the same invariant while feature branches use prisma db push (AD-21).
createdByUserId String?
displayName String
mimeType String
sizeBytes Int
@@ -87,16 +97,18 @@ model File {
tags String[] @default([])
notes String?
source FileSource @default(manual_upload)
// Customer-portal upload prepared (DoD 12): nullable attribution, full portal
// flow = v2. Defaults to empty/invisible.
createdByPortalUserId String?
isDemoData Boolean @default(false)
archivedAt DateTime?
links FileEntityLink[]
createdByPortalUser PortalUser? @relation("PortalFileActor", fields: [createdByPortalUserId, tenantId], references: [id, tenantId], onDelete: Restrict)
portalDocuments PortalProjectDocument[]
@@unique([id, tenantId])
@@index([tenantId, archivedAt, createdAt(sort: Desc)])
@@index([tenantId, createdByUserId])
@@index([tenantId, createdByPortalUserId])
@@index([tenantId, assignedToUserId])
@@index([tenantId, checksumSha256])
// pg_trgm GIN index for fast ILIKE search on displayName; created originally
@@ -112,17 +124,21 @@ model FileEntityLink {
id String @id @default(cuid())
createdAt DateTime @default(now())
tenantId String
createdByUserId String
/// Exactly one actor column is set; see the merge-migration CHECK contract.
createdByUserId String?
createdByPortalUserId String?
fileId String
entityType FileEntityType
entityId String
linkRole String?
file File @relation(fields: [fileId], references: [id], onDelete: Cascade)
createdByPortalUser PortalUser? @relation("PortalFileEntityLinkActor", fields: [createdByPortalUserId, tenantId], references: [id, tenantId], onDelete: Restrict)
@@unique([fileId, entityType, entityId])
@@index([tenantId, entityType, entityId])
@@index([tenantId, fileId])
@@index([tenantId, createdByPortalUserId])
}
/// Chunked-upload session (replaces spec `FileUploadProgress`, renamed to avoid
@@ -134,7 +150,9 @@ model FileUpload {
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
tenantId String
createdByUserId String
/// Exactly one actor column is set; see the merge-migration CHECK contract.
createdByUserId String?
createdByPortalUserId String?
originalFilename String
totalSizeBytes Int
mimeType String
@@ -146,8 +164,10 @@ model FileUpload {
failureReason String?
chunks FileUploadChunk[]
createdByPortalUser PortalUser? @relation("PortalFileUploadActor", fields: [createdByPortalUserId, tenantId], references: [id, tenantId], onDelete: Restrict)
@@index([tenantId, createdByUserId, status])
@@index([tenantId, createdByPortalUserId, status])
@@index([expiresAt])
}