Skip to content
Closed
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
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@

- clone repo
- Update `.env` and `prisma/.env`
- Make sure Postgres is up and running
- Make sure Postgres is up and running, using `docker-compose up` in a separate terminal
- `npm i`
- `npm run test`
- Create DB structure and apply migrations `npx prisma migrate up -c --experimental`
- Create DB structure `npx prisma db push`
- Apply migrations`npx prisma migrate dev`
- `npm run test:e2e`
- Seed initial data `npx ts-node prisma/seed.ts`
- Seed initial data `npx prisma db seed`
- `npm run start:debug`

## Local HTTPS config
Expand Down
117 changes: 51 additions & 66 deletions package-lock.json

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

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@nestjs/swagger": "^5.2.0",
"@nestjs/terminus": "^8.0.8",
"@nestjs/websockets": "^8.4.1",
"@prisma/client": "2.12.1",
"@prisma/client": "^3.15.2",
"ajv": "^8.10.0",
"bcryptjs": "^2.4.3",
"cache-manager": "^3.6.0",
Expand All @@ -58,7 +58,6 @@
"@nestjs/cli": "^8.2.3",
"@nestjs/schematics": "^8.0.8",
"@nestjs/testing": "^8.4.1",
"@prisma/cli": "2.12.1",
"@types/bcryptjs": "^2.4.2",
"@types/cache-manager": "^3.4.3",
"@types/cron": "^1.7.3",
Expand All @@ -80,11 +79,15 @@
"eslint-plugin-import": "^2.25.4",
"jest": "^27.5.1",
"prettier": "^2.6.0",
"prisma": "^3.15.2",
"supertest": "^6.2.2",
"ts-jest": "^27.1.3",
"ts-loader": "^9.2.8",
"ts-node": "^10.7.0",
"tsconfig-paths": "^3.14.0",
"typescript": "^4.6.2"
},
"prisma": {
"seed": "ts-node prisma/seed.ts"
}
}
2 changes: 1 addition & 1 deletion prisma/manual_migrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async function shouldSkipMigration(migrationKey: string): Promise<boolean> {
SELECT revision, status from "public"."_Migration"
WHERE "name" like ${`%${migrationKey}%`}
AND "status" = 'MigrationSuccess'
LIMIT 1`.then((migration) => migration?.length > 0);
LIMIT 1`.then((migration) => (migration as any)?.length > 0);
}

//https://github.com/Visual-Regression-Tracker/Visual-Regression-Tracker/issues/243
Expand Down
16 changes: 9 additions & 7 deletions prisma/migrations/20200503001556-init/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ generator client {

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

model Build {
id String @default(uuid()) @id
id String @id @default(uuid())
number Int?
branchName String?
status String?
Expand All @@ -19,10 +19,12 @@ model Build {
// user User @relation(fields: [userId], references: [id])
updatedAt DateTime @updatedAt
createdAt DateTime @default(now())
User User? @relation(fields: [userId], references: [id])
userId String?
}

model Project {
id String @default(uuid()) @id
id String @id @default(uuid())
name String
builds Build[]
testVariations TestVariation[]
Expand All @@ -31,7 +33,7 @@ model Project {
}

model TestRun {
id String @default(uuid()) @id
id String @id @default(uuid())
imageName String
diffName String?
diffPercent Float?
Expand All @@ -47,7 +49,7 @@ model TestRun {
}

model TestVariation {
id String @default(uuid()) @id
id String @id @default(uuid())
name String
browser String?
device String?
Expand All @@ -63,7 +65,7 @@ model TestVariation {
}

model User {
id String @default(uuid()) @id
id String @id @default(uuid())
email String @unique
password String
firstName String?
Expand All @@ -80,4 +82,4 @@ enum TestStatus {
new
ok
unresolved
}
}
18 changes: 9 additions & 9 deletions prisma/migrations/20200524162125-baseline-history/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ generator client {

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

model Build {
id String @default(uuid()) @id
id String @id @default(uuid())
number Int?
branchName String?
status String?
Expand All @@ -22,7 +22,7 @@ model Build {
}

model Project {
id String @default(uuid()) @id
id String @id @default(uuid())
name String
builds Build[]
testVariations TestVariation[]
Expand All @@ -31,7 +31,7 @@ model Project {
}

model TestRun {
id String @default(uuid()) @id
id String @id @default(uuid())
imageName String
diffName String?
diffPercent Float?
Expand All @@ -57,7 +57,7 @@ model TestRun {
}

model TestVariation {
id String @default(uuid()) @id
id String @id @default(uuid())
name String
browser String?
device String?
Expand All @@ -74,18 +74,18 @@ model TestVariation {
}

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?
testRunId String? @unique
testRun TestRun? @relation(fields: [testRunId], references: [id])
updatedAt DateTime @updatedAt
createdAt DateTime @default(now())
}

model User {
id String @default(uuid()) @id
id String @id @default(uuid())
email String @unique
password String
firstName String?
Expand All @@ -102,4 +102,4 @@ enum TestStatus {
new
ok
unresolved
}
}
Loading