Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@nestjs/platform-socket.io": "^7.4.2",
"@nestjs/swagger": "^4.5.12",
"@nestjs/websockets": "^7.4.2",
"@prisma/client": "^2.4.1",
"@prisma/client": "^2.8.1",
"bcryptjs": "^2.4.3",
"class-transformer": "^0.3.1",
"class-validator": "^0.12.2",
Expand All @@ -52,7 +52,7 @@
"@nestjs/cli": "^7.4.1",
"@nestjs/schematics": "^7.0.1",
"@nestjs/testing": "^7.4.2",
"@prisma/cli": "^2.4.1",
"@prisma/cli": "^2.8.1",
"@types/bcryptjs": "^2.4.2",
"@types/express": "^4.17.7",
"@types/jest": "26.0.5",
Expand Down
91 changes: 91 additions & 0 deletions prisma/migrations/20201007145002-builds-counter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Migration `20201007145002-builds-counter`

This migration has been generated by Pavel Strunkin at 10/7/2020, 5:50:02 PM.
You can check out the [state of the schema](./schema.prisma) after the migration.

## Database Steps

```sql
ALTER TABLE "public"."Project" ADD COLUMN "buildsCounter" integer NOT NULL DEFAULT 0
```

## Changes

```diff
diff --git schema.prisma schema.prisma
migration 20200909223305-test-variation-project-id-added-into-unique-constraint..20201007145002-builds-counter
--- datamodel.dml
+++ datamodel.dml
@@ -1,15 +1,16 @@
generator client {
provider = "prisma-client-js"
+ previewFeatures = ["atomicNumberOperations"]
}
datasource db {
- provider = "postgresql"
- url = "***"
+ provider = "postgresql"
+ url = "***"
}
model Build {
- id String @default(uuid()) @id
+ id String @id @default(uuid())
number Int?
branchName String?
status String?
testRuns TestRun[]
@@ -22,21 +23,22 @@
isRunning Boolean?
}
model Project {
- id String @default(uuid()) @id
+ id String @id @default(uuid())
name String
mainBranchName String @default("master")
builds Build[]
+ buildsCounter Int @default(0)
testVariations TestVariation[]
updatedAt DateTime @updatedAt
createdAt DateTime @default(now())
@@unique([name])
}
model TestRun {
- id String @default(uuid()) @id
+ id String @id @default(uuid())
imageName String
diffName String?
diffPercent Float?
diffTollerancePercent Float @default(0)
@@ -63,9 +65,9 @@
baselineBranchName String?
}
model TestVariation {
- id String @default(uuid()) @id
+ id String @id @default(uuid())
name String
branchName String @default("master")
browser String?
device String?
@@ -84,9 +86,9 @@
@@unique([projectId, name, browser, device, os, viewport, branchName])
}
model Baseline {
- id String @default(uuid()) @id
+ id String @id @default(uuid())
baselineName String
testVariationId String
testVariation TestVariation @relation(fields: [testVariationId], references: [id])
testRunId String?
@@ -95,9 +97,9 @@
createdAt DateTime @default(now())
}
model User {
- id String @default(uuid()) @id
+ id String @id @default(uuid())
email String @unique
password String
firstName String?
lastName String?
```


119 changes: 119 additions & 0 deletions prisma/migrations/20201007145002-builds-counter/schema.prisma
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
generator client {
provider = "prisma-client-js"
previewFeatures = ["atomicNumberOperations"]
}

datasource db {
provider = "postgresql"
url = "***"
}

model Build {
id String @id @default(uuid())
number Int?
branchName String?
status String?
testRuns TestRun[]
projectId String
project Project @relation(fields: [projectId], references: [id])
updatedAt DateTime @updatedAt
createdAt DateTime @default(now())
user User? @relation(fields: [userId], references: [id])
userId String?
isRunning Boolean?
}

model Project {
id String @id @default(uuid())
name String
mainBranchName String @default("master")
builds Build[]
buildsCounter Int @default(0)
testVariations TestVariation[]
updatedAt DateTime @updatedAt
createdAt DateTime @default(now())

@@unique([name])
}

model TestRun {
id String @id @default(uuid())
imageName String
diffName String?
diffPercent Float?
diffTollerancePercent Float @default(0)
pixelMisMatchCount Int?
status TestStatus
buildId String
build Build @relation(fields: [buildId], references: [id])
testVariationId String
testVariation TestVariation @relation(fields: [testVariationId], references: [id])
merge Boolean @default(false)
updatedAt DateTime @updatedAt
createdAt DateTime @default(now())
// Test variation data
name String @default("")
browser String?
device String?
os String?
viewport String?
baselineName String?
ignoreAreas String @default("[]")
comment String?
baseline Baseline?
branchName String @default("master")
baselineBranchName String?
}

model TestVariation {
id String @id @default(uuid())
name String
branchName String @default("master")
browser String?
device String?
os String?
viewport String?
baselineName String?
ignoreAreas String @default("[]")
projectId String
project Project @relation(fields: [projectId], references: [id])
testRuns TestRun[]
baselines Baseline[]
comment String?
updatedAt DateTime @updatedAt
createdAt DateTime @default(now())

@@unique([projectId, name, browser, device, os, viewport, branchName])
}

model Baseline {
id String @id @default(uuid())
baselineName String
testVariationId String
testVariation TestVariation @relation(fields: [testVariationId], references: [id])
testRunId String?
testRun TestRun? @relation(fields: [testRunId], references: [id])
updatedAt DateTime @updatedAt
createdAt DateTime @default(now())
}

model User {
id String @id @default(uuid())
email String @unique
password String
firstName String?
lastName String?
apiKey String @unique
isActive Boolean @default(true)
builds Build[]
updatedAt DateTime @updatedAt
createdAt DateTime @default(now())
}

enum TestStatus {
failed
new
ok
unresolved
approved
}
37 changes: 37 additions & 0 deletions prisma/migrations/20201007145002-builds-counter/steps.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"version": "0.3.14-fixed",
"steps": [
{
"tag": "CreateField",
"model": "Project",
"field": "buildsCounter",
"type": "Int",
"arity": "Required"
},
{
"tag": "CreateDirective",
"location": {
"path": {
"tag": "Field",
"model": "Project",
"field": "buildsCounter"
},
"directive": "default"
}
},
{
"tag": "CreateArgument",
"location": {
"tag": "Directive",
"path": {
"tag": "Field",
"model": "Project",
"field": "buildsCounter"
},
"directive": "default"
},
"argument": "",
"value": "0"
}
]
}
3 changes: 2 additions & 1 deletion prisma/migrations/migrate.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
20200715232608-branch-strategy
20200728221159-zero-diff-tolerance
20200812213545-build-run-status
20200909223305-test-variation-project-id-added-into-unique-constraint
20200909223305-test-variation-project-id-added-into-unique-constraint
20201007145002-builds-counter
24 changes: 12 additions & 12 deletions prisma/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions prisma/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
"license": "UNLICENSED",
"scripts": {},
"dependencies": {
"@prisma/client": "^2.2.2",
"@prisma/client": "^2.8.1",
"bcryptjs": "^2.4.3",
"uuid-apikey": "^1.4.6"
},
"devDependencies": {
"@prisma/cli": "^2.4.1",
"@prisma/cli": "^2.8.1",
"@types/bcryptjs": "^2.4.2",
"@types/uuid-apikey": "^1.4.0",
"ts-node": "^8.10.2",
Expand Down
Loading