Skip to content

Commit dbccc3b

Browse files
authored
Merge pull request #20 from Visual-Regression-Tracker/72-branch-merge
72 branch merge
2 parents 1778f10 + f78c7ac commit dbccc3b

25 files changed

+647
-115
lines changed

package-lock.json

Lines changed: 19 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"@nestjs/platform-socket.io": "^7.1.3",
3131
"@nestjs/swagger": "^4.5.1",
3232
"@nestjs/websockets": "^7.1.3",
33-
"@prisma/client": "^2.0.0-beta.6",
33+
"@prisma/client": "^2.2.2",
3434
"bcryptjs": "^2.4.3",
3535
"class-transformer": "^0.2.3",
3636
"class-validator": "^0.11.1",
@@ -52,7 +52,7 @@
5252
"@nestjs/cli": "^7.0.0",
5353
"@nestjs/schematics": "^7.0.0",
5454
"@nestjs/testing": "^7.0.0",
55-
"@prisma/cli": "^2.0.0-beta.6",
55+
"@prisma/cli": "^2.2.2",
5656
"@types/bcryptjs": "^2.4.2",
5757
"@types/express": "^4.17.3",
5858
"@types/jest": "25.1.4",
Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,27 @@
1-
# Migration `20200711125803-branch-strategy`
1+
# Migration `20200715232608-branch-strategy`
22

3-
This migration has been generated by Pavel Strunkin at 7/11/2020, 12:58:03 PM.
3+
This migration has been generated by Pavel Strunkin at 7/15/2020, 11:26:08 PM.
44
You can check out the [state of the schema](./schema.prisma) after the migration.
55

66
## Database Steps
77

88
```sql
9-
ALTER TABLE "public"."Project" ADD COLUMN "mainBranchName" text NOT NULL DEFAULT E'master';
10-
11-
ALTER TABLE "public"."TestRun" ADD COLUMN "baselineBranchName" text ,
12-
ADD COLUMN "branchName" text NOT NULL DEFAULT E'master';
13-
14-
ALTER TABLE "public"."TestVariation" ADD COLUMN "branchName" text NOT NULL DEFAULT E'master';
9+
CREATE UNIQUE INDEX "TestVariation.name_browser_device_os_viewport_branchName" ON "public"."TestVariation"("name","browser","device","os","viewport","branchName")
1510
```
1611

1712
## Changes
1813

1914
```diff
2015
diff --git schema.prisma schema.prisma
21-
migration 20200707182652-project-name-unique-constraint..20200711125803-branch-strategy
16+
migration 20200707182652-project-name-unique-constraint..20200715232608-branch-strategy
2217
--- datamodel.dml
2318
+++ datamodel.dml
2419
@@ -3,9 +3,9 @@
2520
}
2621
datasource db {
2722
provider = "postgresql"
2823
- url = "***"
29-
+ url = env("DATABASE_URL")
24+
+ url = "***"
3025
}
3126
model Build {
3227
id String @default(uuid()) @id
@@ -39,7 +34,17 @@ migration 20200707182652-project-name-unique-constraint..20200711125803-branch-s
3934
testVariations TestVariation[]
4035
updatedAt DateTime @updatedAt
4136
createdAt DateTime @default(now())
42-
@@ -55,8 +56,10 @@
37+
@@ -43,8 +44,9 @@
38+
buildId String
39+
build Build @relation(fields: [buildId], references: [id])
40+
testVariationId String
41+
testVariation TestVariation @relation(fields: [testVariationId], references: [id])
42+
+ merge Boolean @default(false)
43+
updatedAt DateTime @updatedAt
44+
createdAt DateTime @default(now())
45+
// Test variation data
46+
name String @default("")
47+
@@ -55,13 +57,16 @@
4348
baselineName String?
4449
ignoreAreas String @default("[]")
4550
comment String?
@@ -49,15 +54,22 @@ migration 20200707182652-project-name-unique-constraint..20200711125803-branch-s
4954
}
5055
model TestVariation {
5156
id String @default(uuid()) @id
52-
@@ -71,8 +74,9 @@
53-
project Project @relation(fields: [projectId], references: [id])
54-
testRuns TestRun[]
57+
name String
58+
+ branchName String @default("master")
59+
browser String?
60+
device String?
61+
os String?
62+
viewport String?
63+
@@ -73,8 +78,10 @@
5564
baselines Baseline[]
5665
comment String?
57-
+ branchName String @default("master")
5866
updatedAt DateTime @updatedAt
5967
createdAt DateTime @default(now())
68+
+
69+
+ @@unique([name, browser, device, os, viewport, branchName])
6070
}
71+
model Baseline {
72+
id String @default(uuid()) @id
6173
```
6274

6375

prisma/migrations/20200711125803-branch-strategy/schema.prisma renamed to prisma/migrations/20200715232608-branch-strategy/schema.prisma

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ model TestRun {
4545
build Build @relation(fields: [buildId], references: [id])
4646
testVariationId String
4747
testVariation TestVariation @relation(fields: [testVariationId], references: [id])
48+
merge Boolean @default(false)
4849
updatedAt DateTime @updatedAt
4950
createdAt DateTime @default(now())
5051
// Test variation data
@@ -64,6 +65,7 @@ model TestRun {
6465
model TestVariation {
6566
id String @default(uuid()) @id
6667
name String
68+
branchName String @default("master")
6769
browser String?
6870
device String?
6971
os String?
@@ -75,9 +77,10 @@ model TestVariation {
7577
testRuns TestRun[]
7678
baselines Baseline[]
7779
comment String?
78-
branchName String @default("master")
7980
updatedAt DateTime @updatedAt
8081
createdAt DateTime @default(now())
82+
83+
@@unique([name, browser, device, os, viewport, branchName])
8184
}
8285

8386
model Baseline {

prisma/migrations/20200711125803-branch-strategy/steps.json renamed to prisma/migrations/20200715232608-branch-strategy/steps.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,38 @@
3333
"argument": "",
3434
"value": "\"master\""
3535
},
36+
{
37+
"tag": "CreateField",
38+
"model": "TestRun",
39+
"field": "merge",
40+
"type": "Boolean",
41+
"arity": "Required"
42+
},
43+
{
44+
"tag": "CreateDirective",
45+
"location": {
46+
"path": {
47+
"tag": "Field",
48+
"model": "TestRun",
49+
"field": "merge"
50+
},
51+
"directive": "default"
52+
}
53+
},
54+
{
55+
"tag": "CreateArgument",
56+
"location": {
57+
"tag": "Directive",
58+
"path": {
59+
"tag": "Field",
60+
"model": "TestRun",
61+
"field": "merge"
62+
},
63+
"directive": "default"
64+
},
65+
"argument": "",
66+
"value": "false"
67+
},
3668
{
3769
"tag": "CreateField",
3870
"model": "TestRun",
@@ -103,6 +135,22 @@
103135
},
104136
"argument": "",
105137
"value": "\"master\""
138+
},
139+
{
140+
"tag": "CreateDirective",
141+
"location": {
142+
"path": {
143+
"tag": "Model",
144+
"model": "TestVariation",
145+
"arguments": [
146+
{
147+
"name": "",
148+
"value": "[name, browser, device, os, viewport, branchName]"
149+
}
150+
]
151+
},
152+
"directive": "unique"
153+
}
106154
}
107155
]
108156
}

prisma/migrations/migrate.lock

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

prisma/package-lock.json

Lines changed: 61 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)