Skip to content

Commit fe041ff

Browse files
committed
Diff tolerance defaut changed to zero
Visual-Regression-Tracker/Visual-Regression-Tracker#81
1 parent c63782f commit fe041ff

File tree

5 files changed

+179
-2
lines changed

5 files changed

+179
-2
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Migration `20200728221159-zero-diff-tolerance`
2+
3+
This migration has been generated by Pavel Strunkin at 7/28/2020, 10:12:00 PM.
4+
You can check out the [state of the schema](./schema.prisma) after the migration.
5+
6+
## Database Steps
7+
8+
```sql
9+
ALTER TABLE "public"."TestRun" ALTER COLUMN "diffTollerancePercent" SET DEFAULT 0;
10+
```
11+
12+
## Changes
13+
14+
```diff
15+
diff --git schema.prisma schema.prisma
16+
migration 20200715232608-branch-strategy..20200728221159-zero-diff-tolerance
17+
--- datamodel.dml
18+
+++ datamodel.dml
19+
@@ -3,9 +3,9 @@
20+
}
21+
datasource db {
22+
provider = "postgresql"
23+
- url = "***"
24+
+ url = "***"
25+
}
26+
model Build {
27+
id String @default(uuid()) @id
28+
@@ -37,9 +37,9 @@
29+
id String @default(uuid()) @id
30+
imageName String
31+
diffName String?
32+
diffPercent Float?
33+
- diffTollerancePercent Float @default(1.0)
34+
+ diffTollerancePercent Float @default(0)
35+
pixelMisMatchCount Int?
36+
status TestStatus
37+
buildId String
38+
build Build @relation(fields: [buildId], references: [id])
39+
```
40+
41+
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
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+
mainBranchName String @default("master")
28+
builds Build[]
29+
testVariations TestVariation[]
30+
updatedAt DateTime @updatedAt
31+
createdAt DateTime @default(now())
32+
33+
@@unique([name])
34+
}
35+
36+
model TestRun {
37+
id String @default(uuid()) @id
38+
imageName String
39+
diffName String?
40+
diffPercent Float?
41+
diffTollerancePercent Float @default(0)
42+
pixelMisMatchCount Int?
43+
status TestStatus
44+
buildId String
45+
build Build @relation(fields: [buildId], references: [id])
46+
testVariationId String
47+
testVariation TestVariation @relation(fields: [testVariationId], references: [id])
48+
merge Boolean @default(false)
49+
updatedAt DateTime @updatedAt
50+
createdAt DateTime @default(now())
51+
// Test variation data
52+
name String @default("")
53+
browser String?
54+
device String?
55+
os String?
56+
viewport String?
57+
baselineName String?
58+
ignoreAreas String @default("[]")
59+
comment String?
60+
baseline Baseline?
61+
branchName String @default("master")
62+
baselineBranchName String?
63+
}
64+
65+
model TestVariation {
66+
id String @default(uuid()) @id
67+
name String
68+
branchName String @default("master")
69+
browser String?
70+
device String?
71+
os String?
72+
viewport String?
73+
baselineName String?
74+
ignoreAreas String @default("[]")
75+
projectId String
76+
project Project @relation(fields: [projectId], references: [id])
77+
testRuns TestRun[]
78+
baselines Baseline[]
79+
comment String?
80+
updatedAt DateTime @updatedAt
81+
createdAt DateTime @default(now())
82+
83+
@@unique([name, browser, device, os, viewport, branchName])
84+
}
85+
86+
model Baseline {
87+
id String @default(uuid()) @id
88+
baselineName String
89+
testVariationId String
90+
testVariation TestVariation @relation(fields: [testVariationId], references: [id])
91+
testRunId String?
92+
testRun TestRun? @relation(fields: [testRunId], references: [id])
93+
updatedAt DateTime @updatedAt
94+
createdAt DateTime @default(now())
95+
}
96+
97+
model User {
98+
id String @default(uuid()) @id
99+
email String @unique
100+
password String
101+
firstName String?
102+
lastName String?
103+
apiKey String @unique
104+
isActive Boolean @default(true)
105+
builds Build[]
106+
updatedAt DateTime @updatedAt
107+
createdAt DateTime @default(now())
108+
}
109+
110+
enum TestStatus {
111+
failed
112+
new
113+
ok
114+
unresolved
115+
approved
116+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"version": "0.3.14-fixed",
3+
"steps": [
4+
{
5+
"tag": "UpdateArgument",
6+
"location": {
7+
"tag": "Directive",
8+
"path": {
9+
"tag": "Field",
10+
"model": "TestRun",
11+
"field": "diffTollerancePercent"
12+
},
13+
"directive": "default"
14+
},
15+
"argument": "",
16+
"newValue": "0"
17+
}
18+
]
19+
}

prisma/migrations/migrate.lock

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
20200526195312-approved-test-status-added
66
20200627134248-comment-added
77
20200707182652-project-name-unique-constraint
8-
20200715232608-branch-strategy
8+
20200715232608-branch-strategy
9+
20200728221159-zero-diff-tolerance

prisma/schema.prisma

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ model TestRun {
3838
imageName String
3939
diffName String?
4040
diffPercent Float?
41-
diffTollerancePercent Float @default(1.0)
41+
diffTollerancePercent Float @default(0)
4242
pixelMisMatchCount Int?
4343
status TestStatus
4444
buildId String

0 commit comments

Comments
 (0)