1+ generator client {
2+ provider = " prisma-client-js "
3+ }
4+
5+ datasource db {
6+ provider = " postgresql "
7+ url = " ***"
8+ }
9+
10+ model Build {
11+ id String @default (uuid () ) @id
12+ number Int ?
13+ branchName String ?
14+ status String ?
15+ testRuns TestRun []
16+ projectId String
17+ project Project @relation (fields : [projectId ] , references : [id ] )
18+ updatedAt DateTime @updatedAt
19+ createdAt DateTime @default (now () )
20+ user User ? @relation (fields : [userId ] , references : [id ] )
21+ userId String ?
22+ }
23+
24+ model Project {
25+ id String @default (uuid () ) @id
26+ name String
27+ builds Build []
28+ testVariations TestVariation []
29+ updatedAt DateTime @updatedAt
30+ createdAt DateTime @default (now () )
31+ }
32+
33+ model TestRun {
34+ id String @default (uuid () ) @id
35+ imageName String
36+ diffName String ?
37+ diffPercent Float ?
38+ diffTollerancePercent Float @default (1.0 )
39+ pixelMisMatchCount Int ?
40+ status TestStatus
41+ buildId String
42+ build Build @relation (fields : [buildId ] , references : [id ] )
43+ testVariationId String
44+ testVariation TestVariation @relation (fields : [testVariationId ] , references : [id ] )
45+ updatedAt DateTime @updatedAt
46+ createdAt DateTime @default (now () )
47+ // Test variation data
48+ name String @default (" " )
49+ browser String ?
50+ device String ?
51+ os String ?
52+ viewport String ?
53+ baselineName String ?
54+ ignoreAreas String @default (" []" )
55+ // Baseline
56+ baseline Baseline ?
57+ }
58+
59+ model TestVariation {
60+ id String @default (uuid () ) @id
61+ name String
62+ browser String ?
63+ device String ?
64+ os String ?
65+ viewport String ?
66+ baselineName String ?
67+ ignoreAreas String @default (" []" )
68+ projectId String
69+ project Project @relation (fields : [projectId ] , references : [id ] )
70+ testRuns TestRun []
71+ baselines Baseline []
72+ updatedAt DateTime @updatedAt
73+ createdAt DateTime @default (now () )
74+ }
75+
76+ model Baseline {
77+ id String @default (uuid () ) @id
78+ baselineName String
79+ testVariationId String
80+ testVariation TestVariation @relation (fields : [testVariationId ] , references : [id ] )
81+ testRunId String ?
82+ testRun TestRun ? @relation (fields : [testRunId ] , references : [id ] )
83+ updatedAt DateTime @updatedAt
84+ createdAt DateTime @default (now () )
85+ }
86+
87+ model User {
88+ id String @default (uuid () ) @id
89+ email String @unique
90+ password String
91+ firstName String ?
92+ lastName String ?
93+ apiKey String @unique
94+ isActive Boolean @default (true )
95+ builds Build []
96+ updatedAt DateTime @updatedAt
97+ createdAt DateTime @default (now () )
98+ }
99+
100+ enum TestStatus {
101+ failed
102+ new
103+ ok
104+ unresolved
105+ approved
106+ }
0 commit comments