@trycompai/db 2.3.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/schema.prisma +32 -4
- package/package.json +1 -1
package/dist/schema.prisma
CHANGED
|
@@ -630,20 +630,35 @@ model CustomRequirement {
|
|
|
630
630
|
description String
|
|
631
631
|
identifier String
|
|
632
632
|
|
|
633
|
-
organizationId
|
|
634
|
-
organization
|
|
635
|
-
|
|
633
|
+
organizationId String
|
|
634
|
+
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
635
|
+
|
|
636
|
+
// A custom requirement hangs off either a CustomFramework (the org authored
|
|
637
|
+
// a whole new framework) or a single FrameworkInstance (the org tacked an
|
|
638
|
+
// extra requirement onto a platform framework like ISO 27001). Exactly one
|
|
639
|
+
// of these is set — enforced by a DB CHECK constraint.
|
|
640
|
+
customFrameworkId String?
|
|
636
641
|
// Composite FK onto (id, organizationId) so tenant consistency with the
|
|
637
642
|
// referenced CustomFramework is enforced at the DB level.
|
|
638
|
-
customFramework CustomFramework @relation(fields: [customFrameworkId, organizationId], references: [id, organizationId], onDelete: Cascade)
|
|
643
|
+
customFramework CustomFramework? @relation(fields: [customFrameworkId, organizationId], references: [id, organizationId], onDelete: Cascade)
|
|
644
|
+
|
|
645
|
+
frameworkInstanceId String?
|
|
646
|
+
// Composite FK onto (id, organizationId) so a per-instance custom requirement
|
|
647
|
+
// can only point at an FI in its own org.
|
|
648
|
+
frameworkInstance FrameworkInstance? @relation(fields: [frameworkInstanceId, organizationId], references: [id, organizationId], onDelete: Cascade)
|
|
639
649
|
|
|
640
650
|
requirementMaps RequirementMap[]
|
|
641
651
|
|
|
642
652
|
createdAt DateTime @default(now())
|
|
643
653
|
updatedAt DateTime @default(now()) @updatedAt
|
|
644
654
|
|
|
655
|
+
// Identifier uniqueness scoped to whichever parent is set. Postgres treats
|
|
656
|
+
// NULLs as distinct in unique indexes, so the inactive parent column doesn't
|
|
657
|
+
// collide across rows.
|
|
645
658
|
@@unique([customFrameworkId, identifier])
|
|
659
|
+
@@unique([frameworkInstanceId, identifier])
|
|
646
660
|
@@index([organizationId])
|
|
661
|
+
@@index([frameworkInstanceId])
|
|
647
662
|
}
|
|
648
663
|
|
|
649
664
|
// ===== device.prisma =====
|
|
@@ -1139,7 +1154,14 @@ model FrameworkInstance {
|
|
|
1139
1154
|
requirementsMapped RequirementMap[]
|
|
1140
1155
|
timelineInstances TimelineInstance[]
|
|
1141
1156
|
syncOperations FrameworkSyncOperation[]
|
|
1157
|
+
// Per-instance custom requirements (used when an org tacks an extra requirement
|
|
1158
|
+
// onto a platform framework instance). Custom requirements attached to a
|
|
1159
|
+
// CustomFramework hang off CustomFramework.requirements instead.
|
|
1160
|
+
customRequirements CustomRequirement[]
|
|
1142
1161
|
|
|
1162
|
+
// (id, organizationId) is the composite-FK target for CustomRequirement.frameworkInstanceId
|
|
1163
|
+
// so a per-instance custom requirement can only point at an FI in its own org.
|
|
1164
|
+
@@unique([id, organizationId])
|
|
1143
1165
|
@@unique([organizationId, frameworkId])
|
|
1144
1166
|
@@unique([organizationId, customFrameworkId])
|
|
1145
1167
|
@@index([customFrameworkId])
|
|
@@ -2983,6 +3005,8 @@ model Trust {
|
|
|
2983
3005
|
hipaa Boolean @default(false)
|
|
2984
3006
|
pci_dss Boolean @default(false)
|
|
2985
3007
|
iso9001 Boolean @default(false)
|
|
3008
|
+
pipeda Boolean @default(false)
|
|
3009
|
+
ccpa Boolean @default(false)
|
|
2986
3010
|
|
|
2987
3011
|
soc2_status FrameworkStatus @default(started)
|
|
2988
3012
|
soc2type1_status FrameworkStatus @default(started)
|
|
@@ -2995,6 +3019,8 @@ model Trust {
|
|
|
2995
3019
|
hipaa_status FrameworkStatus @default(started)
|
|
2996
3020
|
pci_dss_status FrameworkStatus @default(started)
|
|
2997
3021
|
iso9001_status FrameworkStatus @default(started)
|
|
3022
|
+
pipeda_status FrameworkStatus @default(started)
|
|
3023
|
+
ccpa_status FrameworkStatus @default(started)
|
|
2998
3024
|
|
|
2999
3025
|
// Overview section for public trust portal
|
|
3000
3026
|
overviewTitle String?
|
|
@@ -3032,6 +3058,8 @@ enum TrustFramework {
|
|
|
3032
3058
|
pci_dss
|
|
3033
3059
|
nen_7510
|
|
3034
3060
|
iso_9001
|
|
3061
|
+
pipeda
|
|
3062
|
+
ccpa
|
|
3035
3063
|
}
|
|
3036
3064
|
|
|
3037
3065
|
model TrustResource {
|