diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 7a49d135..b929517c 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -5,7 +5,7 @@ on: [push] jobs: build: # https://github.com/actions/runner-images#available-images - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 @@ -13,14 +13,11 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '14.16.1' + node-version: '18' - name: Install npm dependencies run: npm ci - - name: Prisma generate - run: npm run prisma:generate - - name: Unit tests run: npm run test:cov diff --git a/Dockerfile b/Dockerfile index 84de306e..3537be01 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,16 @@ # https://github.com/Visual-Regression-Tracker/Visual-Regression-Tracker/issues/137 -FROM node:14-alpine3.17 AS builder +FROM node:18-alpine3.18 AS builder # Create app directory WORKDIR /app -RUN npm install -g @prisma/cli@2.12.1 --unsafe-perm - COPY ./prisma/schema.prisma ./ # A wildcard is used to ensure both package.json AND package-lock.json are copied COPY package*.json ./ # Install app dependencies -RUN npm install +RUN npm ci --verbose COPY tsconfig*.json ./ COPY src ./src @@ -20,7 +18,7 @@ COPY src ./src RUN npm run build # https://github.com/Visual-Regression-Tracker/Visual-Regression-Tracker/issues/137 -FROM node:14-alpine3.17 +FROM node:18-alpine3.18 COPY --from=builder /app/node_modules ./node_modules COPY --from=builder /app/package*.json ./ COPY --from=builder /app/dist ./dist diff --git a/README.md b/README.md index 9432dcfd..24ed1b77 100644 --- a/README.md +++ b/README.md @@ -8,12 +8,13 @@ - Install Node `14` - 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 deploy` - `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 diff --git a/docker-compose.yml b/docker-compose.yml index c52a1072..abdfb3b3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -28,7 +28,7 @@ services: - postgres postgres: container_name: postgres - image: postgres:12-alpine3.18 + image: postgres:15.3-alpine3.18 restart: always environment: POSTGRES_USER: ${POSTGRES_USER} @@ -40,9 +40,13 @@ services: - "${POSTGRES_PORT}" volumes: - postgres:/var/lib/postgresql/data + + # Available at http://localhost:5050 pgadmin: container_name: pgadmin4 - image: dpage/pgadmin4 + # https://hub.docker.com/r/dpage/pgadmin4 + # https://www.pgadmin.org/docs/pgadmin4/latest/release_notes_7_4.html + image: dpage/pgadmin4:7.4 restart: always environment: PGADMIN_DEFAULT_EMAIL: admin@admin.com diff --git a/package-lock.json b/package-lock.json index e54414ac..b1aec0ec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,7 @@ "": { "name": "vrt-backend", "version": "1.1.0", - "license": "UNLICENSED", + "license": "Apache-2.0", "dependencies": { "@nestjs/common": "^8.4.1", "@nestjs/config": "^1.2.0", @@ -20,7 +20,7 @@ "@nestjs/swagger": "^5.2.0", "@nestjs/terminus": "^8.0.8", "@nestjs/websockets": "^8.4.1", - "@prisma/client": "2.12.1", + "@prisma/client": "^5.0.0", "ajv": "^8.10.0", "bcryptjs": "^2.4.3", "cache-manager": "^3.6.0", @@ -46,7 +46,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", @@ -68,12 +67,16 @@ "eslint-plugin-import": "^2.25.4", "jest": "^27.5.1", "prettier": "^2.6.0", + "prisma": "^5.0.0", "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" + "typescript": "^4.9.2" + }, + "engines": { + "node": ">=16.13.0" } }, "node_modules/@ampproject/remapping": { @@ -2288,62 +2291,37 @@ "npm": ">=5.0.0" } }, - "node_modules/@prisma/bar": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/@prisma/bar/-/bar-0.0.1.tgz", - "integrity": "sha512-FVLhwVkbfhXlBhroWfIXMLi+3Jh9IEzYp+9z+MUUiw3ZsbcoAil7CN9/QIjHc4/TcCRyRfuSmT7qCnn4O+TjJw==", - "devOptional": true - }, - "node_modules/@prisma/cli": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/@prisma/cli/-/cli-2.12.1.tgz", - "integrity": "sha512-obkwK95dEeifCdVehG0rS0BlPQGLsOtc9U1MgbrjNX3MnhXQdwROnvymfPB3DBlNyoLoHGklPgi9UlwBokNXcQ==", - "deprecated": "Prisma CLI package was renamed to 'prisma'. Check it out here: https://www.npmjs.com/package/prisma", - "devOptional": true, - "hasInstallScript": true, - "dependencies": { - "@prisma/bar": "^0.0.1", - "@prisma/engines": "2.12.0-18.cf0680a1bfe8d5e743dc659cc7f08009f9587d58" - }, - "bin": { - "prisma": "build/index.js", - "prisma2": "build/index.js" - }, - "engines": { - "node": ">=10.4" - } - }, "node_modules/@prisma/client": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/@prisma/client/-/client-2.12.1.tgz", - "integrity": "sha512-HP4/E9sRdxw/FB7XP4EeRa5ri8Lp1U/L7G4VAA95aM8C+8ARioQHMNDpEjC83NrOrOr4EcaZV5pXDDQL1H+F0g==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@prisma/client/-/client-5.0.0.tgz", + "integrity": "sha512-XlO5ELNAQ7rV4cXIDJUNBEgdLwX3pjtt9Q/RHqDpGf43szpNJx2hJnggfFs7TKNx0cOFsl6KJCSfqr5duEU/bQ==", "hasInstallScript": true, "dependencies": { - "@prisma/engines-version": "2.12.0-18.cf0680a1bfe8d5e743dc659cc7f08009f9587d58" + "@prisma/engines-version": "4.17.0-26.6b0aef69b7cdfc787f822ecd7cdc76d5f1991584" }, "engines": { - "node": ">=10.4" + "node": ">=16.13" }, "peerDependencies": { - "@prisma/cli": "*" + "prisma": "*" }, "peerDependenciesMeta": { - "@prisma/cli": { + "prisma": { "optional": true } } }, "node_modules/@prisma/engines": { - "version": "2.12.0-18.cf0680a1bfe8d5e743dc659cc7f08009f9587d58", - "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-2.12.0-18.cf0680a1bfe8d5e743dc659cc7f08009f9587d58.tgz", - "integrity": "sha512-F6RmUZ5JpPWxmGvVDji8c4gepHIGkvYbtuFi0IoDDJVaCVo8yS656stciKFyswI6/BLWXa0X47/MIMbz6nzw7g==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-5.0.0.tgz", + "integrity": "sha512-kyT/8fd0OpWmhAU5YnY7eP31brW1q1YrTGoblWrhQJDiN/1K+Z8S1kylcmtjqx5wsUGcP1HBWutayA/jtyt+sg==", "devOptional": true, "hasInstallScript": true }, "node_modules/@prisma/engines-version": { - "version": "2.12.0-18.cf0680a1bfe8d5e743dc659cc7f08009f9587d58", - "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-2.12.0-18.cf0680a1bfe8d5e743dc659cc7f08009f9587d58.tgz", - "integrity": "sha512-IHb/Jag1Wmoq5tLZhOHP5zqLHEXqQEfrHb6l0drIBSvh2AF7yWQ3yyuD0ZEb1Nq37SvbBgop5wrWMOU8YWFTGQ==" + "version": "4.17.0-26.6b0aef69b7cdfc787f822ecd7cdc76d5f1991584", + "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-4.17.0-26.6b0aef69b7cdfc787f822ecd7cdc76d5f1991584.tgz", + "integrity": "sha512-HHiUF6NixsldsP3JROq07TYBLEjXFKr6PdH8H4gK/XAoTmIplOJBCgrIUMrsRAnEuGyRoRLXKXWUb943+PFoKQ==" }, "node_modules/@sinonjs/commons": { "version": "1.8.3", @@ -9532,6 +9510,22 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/prisma": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/prisma/-/prisma-5.0.0.tgz", + "integrity": "sha512-KYWk83Fhi1FH59jSpavAYTt2eoMVW9YKgu8ci0kuUnt6Dup5Qy47pcB4/TLmiPAbhGrxxSz7gsSnJcCmkyPANA==", + "devOptional": true, + "hasInstallScript": true, + "dependencies": { + "@prisma/engines": "5.0.0" + }, + "bin": { + "prisma": "build/index.js" + }, + "engines": { + "node": ">=16.13" + } + }, "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -11138,9 +11132,9 @@ } }, "node_modules/typescript": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.2.tgz", - "integrity": "sha512-HM/hFigTBHZhLXshn9sN37H085+hQGeJHJ/X7LpBWLID/fbc2acUMfU+lGD98X81sKP+pFa9f0DZmCwB9GnbAg==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -13372,40 +13366,24 @@ "node-fetch": "^2.6.1" } }, - "@prisma/bar": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/@prisma/bar/-/bar-0.0.1.tgz", - "integrity": "sha512-FVLhwVkbfhXlBhroWfIXMLi+3Jh9IEzYp+9z+MUUiw3ZsbcoAil7CN9/QIjHc4/TcCRyRfuSmT7qCnn4O+TjJw==", - "devOptional": true - }, - "@prisma/cli": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/@prisma/cli/-/cli-2.12.1.tgz", - "integrity": "sha512-obkwK95dEeifCdVehG0rS0BlPQGLsOtc9U1MgbrjNX3MnhXQdwROnvymfPB3DBlNyoLoHGklPgi9UlwBokNXcQ==", - "devOptional": true, - "requires": { - "@prisma/bar": "^0.0.1", - "@prisma/engines": "2.12.0-18.cf0680a1bfe8d5e743dc659cc7f08009f9587d58" - } - }, "@prisma/client": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/@prisma/client/-/client-2.12.1.tgz", - "integrity": "sha512-HP4/E9sRdxw/FB7XP4EeRa5ri8Lp1U/L7G4VAA95aM8C+8ARioQHMNDpEjC83NrOrOr4EcaZV5pXDDQL1H+F0g==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@prisma/client/-/client-5.0.0.tgz", + "integrity": "sha512-XlO5ELNAQ7rV4cXIDJUNBEgdLwX3pjtt9Q/RHqDpGf43szpNJx2hJnggfFs7TKNx0cOFsl6KJCSfqr5duEU/bQ==", "requires": { - "@prisma/engines-version": "2.12.0-18.cf0680a1bfe8d5e743dc659cc7f08009f9587d58" + "@prisma/engines-version": "4.17.0-26.6b0aef69b7cdfc787f822ecd7cdc76d5f1991584" } }, "@prisma/engines": { - "version": "2.12.0-18.cf0680a1bfe8d5e743dc659cc7f08009f9587d58", - "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-2.12.0-18.cf0680a1bfe8d5e743dc659cc7f08009f9587d58.tgz", - "integrity": "sha512-F6RmUZ5JpPWxmGvVDji8c4gepHIGkvYbtuFi0IoDDJVaCVo8yS656stciKFyswI6/BLWXa0X47/MIMbz6nzw7g==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-5.0.0.tgz", + "integrity": "sha512-kyT/8fd0OpWmhAU5YnY7eP31brW1q1YrTGoblWrhQJDiN/1K+Z8S1kylcmtjqx5wsUGcP1HBWutayA/jtyt+sg==", "devOptional": true }, "@prisma/engines-version": { - "version": "2.12.0-18.cf0680a1bfe8d5e743dc659cc7f08009f9587d58", - "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-2.12.0-18.cf0680a1bfe8d5e743dc659cc7f08009f9587d58.tgz", - "integrity": "sha512-IHb/Jag1Wmoq5tLZhOHP5zqLHEXqQEfrHb6l0drIBSvh2AF7yWQ3yyuD0ZEb1Nq37SvbBgop5wrWMOU8YWFTGQ==" + "version": "4.17.0-26.6b0aef69b7cdfc787f822ecd7cdc76d5f1991584", + "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-4.17.0-26.6b0aef69b7cdfc787f822ecd7cdc76d5f1991584.tgz", + "integrity": "sha512-HHiUF6NixsldsP3JROq07TYBLEjXFKr6PdH8H4gK/XAoTmIplOJBCgrIUMrsRAnEuGyRoRLXKXWUb943+PFoKQ==" }, "@sinonjs/commons": { "version": "1.8.3", @@ -18963,6 +18941,15 @@ } } }, + "prisma": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/prisma/-/prisma-5.0.0.tgz", + "integrity": "sha512-KYWk83Fhi1FH59jSpavAYTt2eoMVW9YKgu8ci0kuUnt6Dup5Qy47pcB4/TLmiPAbhGrxxSz7gsSnJcCmkyPANA==", + "devOptional": true, + "requires": { + "@prisma/engines": "5.0.0" + } + }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -20129,9 +20116,9 @@ } }, "typescript": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.2.tgz", - "integrity": "sha512-HM/hFigTBHZhLXshn9sN37H085+hQGeJHJ/X7LpBWLID/fbc2acUMfU+lGD98X81sKP+pFa9f0DZmCwB9GnbAg==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "dev": true }, "unbox-primitive": { diff --git a/package.json b/package.json index 736733f2..6ee944a5 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,6 @@ "start:dev": "nest start --watch", "start:debug": "nest start --debug --watch", "start:prod": "node dist/main", - "prisma:generate": "prisma generate", "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix", "test": "jest --projects src", "test:watch": "jest --projects src --watch", @@ -22,6 +21,9 @@ "test:e2e": "jest --projects test", "test:acceptance": "jest --projects test_acceptance" }, + "engines": { + "node": ">=16.13.0" + }, "dependencies": { "@nestjs/common": "^8.4.1", "@nestjs/config": "^1.2.0", @@ -34,7 +36,7 @@ "@nestjs/swagger": "^5.2.0", "@nestjs/terminus": "^8.0.8", "@nestjs/websockets": "^8.4.1", - "@prisma/client": "2.12.1", + "@prisma/client": "^5.0.0", "ajv": "^8.10.0", "bcryptjs": "^2.4.3", "cache-manager": "^3.6.0", @@ -60,7 +62,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", @@ -82,11 +83,15 @@ "eslint-plugin-import": "^2.25.4", "jest": "^27.5.1", "prettier": "^2.6.0", + "prisma": "^5.0.0", "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" + "typescript": "^4.9.2" + }, + "prisma": { + "seed": "ts-node prisma/seed.ts" } } diff --git a/prisma/Dockerfile b/prisma/Dockerfile index d1ef95ed..0ab8522d 100644 --- a/prisma/Dockerfile +++ b/prisma/Dockerfile @@ -1,5 +1,5 @@ # https://github.com/Visual-Regression-Tracker/Visual-Regression-Tracker/issues/137 -FROM node:14-alpine3.17 +FROM node:18-alpine3.18 RUN apk add --no-cache bash @@ -7,7 +7,7 @@ WORKDIR /app COPY . . -RUN npm ci +RUN npm ci --verbose RUN chmod +x /app/wait-for-it.sh RUN chmod +x /app/entrypoint.sh diff --git a/prisma/entrypoint.sh b/prisma/entrypoint.sh index b60ad51e..9e4aea53 100644 --- a/prisma/entrypoint.sh +++ b/prisma/entrypoint.sh @@ -5,11 +5,8 @@ set -e echo Start applying migrations... -# apply manual migration -npx ts-node manual_migrations.ts - # apply migration -npx prisma migrate up -c --auto-approve --experimental +npx prisma migrate deploy echo Seeding data... diff --git a/prisma/manual_migrations.ts b/prisma/manual_migrations.ts deleted file mode 100644 index be51893a..00000000 --- a/prisma/manual_migrations.ts +++ /dev/null @@ -1,72 +0,0 @@ -import { PrismaClient, TestVariation } from '@prisma/client'; - -const prisma = new PrismaClient({ - // log: ['query'], -}); - -async function dbSchemaExists(): Promise { - return prisma.$queryRaw`SELECT EXISTS - ( - SELECT 1 - FROM information_schema.tables - WHERE table_schema = 'public' - AND table_name = '_Migration' - )` - .catch(() => false) - .then((result) => (result as Array<{ exists: boolean }>).shift()?.exists); -} - -async function shouldSkipMigration(migrationKey: string): Promise { - return prisma.$queryRaw` - SELECT revision, status from "public"."_Migration" - WHERE "name" like ${`%${migrationKey}%`} - AND "status" = 'MigrationSuccess' - LIMIT 1`.then((migration) => migration?.length > 0); -} - -//https://github.com/Visual-Regression-Tracker/Visual-Regression-Tracker/issues/243 -async function setEmptyTestVariationTags_github_243() { - const migrationKey = 'github_243'; - if (await shouldSkipMigration(migrationKey)) { - console.info(`Skipping migration ${migrationKey}...`); - return; - } - console.info(`Going to apply migration ${migrationKey}...`); - const testVariations = (await prisma.$queryRaw` - SELECT * from "public"."TestVariation" - WHERE - "public"."TestVariation"."browser" IS NULL OR - "public"."TestVariation"."os" IS NULL OR - "public"."TestVariation"."device" IS NULL OR - "public"."TestVariation"."viewport" IS NULL - `) as Array; - - return Promise.all( - testVariations.map((testVariation) => - prisma.$executeRaw`UPDATE "public"."TestVariation" - SET - "os" = ${testVariation.os ?? 'NULL::text'}, - "device" = ${testVariation.device ?? 'NULL::text'}, - "browser" = ${testVariation.browser ?? 'NULL::text'}, - "viewport" = ${testVariation.viewport ?? 'NULL::text'} - WHERE - "id" = ${testVariation.id}` - ) - ).then(() => console.info(`Finished migration ${migrationKey}`)) -} - -async function manualMigrations() { - await prisma.$connect(); - if (await dbSchemaExists()) { - console.info('Apply migrations...'); - await setEmptyTestVariationTags_github_243(); - } else { - console.info('DB schema not found. Skipping manual migrations...'); - } - - await prisma.$disconnect(); -} - -manualMigrations() - .catch((e) => console.error('Cannot run manual migrations:', e)) - .finally(async () => await prisma.$disconnect()); diff --git a/prisma/migrations/20200503001556-init/README.md b/prisma/migrations/20200503001556-init/README.md deleted file mode 100644 index ec82fa46..00000000 --- a/prisma/migrations/20200503001556-init/README.md +++ /dev/null @@ -1,139 +0,0 @@ -# Migration `20200503001556-init` - -This migration has been generated by Pavel Strunkin at 5/3/2020, 12:15:56 AM. -You can check out the [state of the schema](./schema.prisma) after the migration. - -## Database Steps - -```sql -CREATE TYPE "TestStatus" AS ENUM ('failed', 'new', 'ok', 'unresolved'); - -CREATE TABLE "public"."Build" ( -"branchName" text ,"createdAt" timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,"id" text NOT NULL ,"number" integer ,"projectId" text NOT NULL ,"status" text ,"updatedAt" timestamp(3) NOT NULL ,"userId" text , - PRIMARY KEY ("id")) - -CREATE TABLE "public"."Project" ( -"createdAt" timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,"id" text NOT NULL ,"name" text NOT NULL ,"updatedAt" timestamp(3) NOT NULL , - PRIMARY KEY ("id")) - -CREATE TABLE "public"."TestRun" ( -"buildId" text NOT NULL ,"createdAt" timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,"diffName" text ,"diffPercent" Decimal(65,30) ,"diffTollerancePercent" Decimal(65,30) NOT NULL DEFAULT 1.0,"id" text NOT NULL ,"imageName" text NOT NULL ,"pixelMisMatchCount" integer ,"status" "TestStatus" NOT NULL ,"testVariationId" text NOT NULL ,"updatedAt" timestamp(3) NOT NULL , - PRIMARY KEY ("id")) - -CREATE TABLE "public"."TestVariation" ( -"baselineName" text ,"browser" text ,"createdAt" timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,"device" text ,"id" text NOT NULL ,"ignoreAreas" text NOT NULL DEFAULT '[]',"name" text NOT NULL ,"os" text ,"projectId" text NOT NULL ,"updatedAt" timestamp(3) NOT NULL ,"viewport" text , - PRIMARY KEY ("id")) - -CREATE TABLE "public"."User" ( -"apiKey" text NOT NULL ,"createdAt" timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,"email" text NOT NULL ,"firstName" text ,"id" text NOT NULL ,"isActive" boolean NOT NULL DEFAULT true,"lastName" text ,"password" text NOT NULL ,"updatedAt" timestamp(3) NOT NULL , - PRIMARY KEY ("id")) - -CREATE UNIQUE INDEX "User.email" ON "public"."User"("email") - -CREATE UNIQUE INDEX "User.apiKey" ON "public"."User"("apiKey") - -ALTER TABLE "public"."Build" ADD FOREIGN KEY ("projectId")REFERENCES "public"."Project"("id") ON DELETE CASCADE ON UPDATE CASCADE - -ALTER TABLE "public"."Build" ADD FOREIGN KEY ("userId")REFERENCES "public"."User"("id") ON DELETE SET NULL ON UPDATE CASCADE - -ALTER TABLE "public"."TestRun" ADD FOREIGN KEY ("buildId")REFERENCES "public"."Build"("id") ON DELETE CASCADE ON UPDATE CASCADE - -ALTER TABLE "public"."TestRun" ADD FOREIGN KEY ("testVariationId")REFERENCES "public"."TestVariation"("id") ON DELETE CASCADE ON UPDATE CASCADE - -ALTER TABLE "public"."TestVariation" ADD FOREIGN KEY ("projectId")REFERENCES "public"."Project"("id") ON DELETE CASCADE ON UPDATE CASCADE -``` - -## Changes - -```diff -diff --git schema.prisma schema.prisma -migration ..20200503001556-init ---- datamodel.dml -+++ datamodel.dml -@@ -1,0 +1,83 @@ -+generator client { -+ provider = "prisma-client-js" -+} -+ -+datasource db { -+ provider = "postgresql" -+ url = env("DATABASE_URL") -+} -+ -+model Build { -+ id String @default(uuid()) @id -+ number Int? -+ branchName String? -+ status String? -+ testRuns TestRun[] -+ projectId String -+ project Project @relation(fields: [projectId], references: [id]) -+ // userId String -+ // user User @relation(fields: [userId], references: [id]) -+ updatedAt DateTime @updatedAt -+ createdAt DateTime @default(now()) -+} -+ -+model Project { -+ id String @default(uuid()) @id -+ name String -+ builds Build[] -+ testVariations TestVariation[] -+ updatedAt DateTime @updatedAt -+ createdAt DateTime @default(now()) -+} -+ -+model TestRun { -+ id String @default(uuid()) @id -+ imageName String -+ diffName String? -+ diffPercent Float? -+ diffTollerancePercent Float @default(1.0) -+ pixelMisMatchCount Int? -+ status TestStatus -+ buildId String -+ build Build @relation(fields: [buildId], references: [id]) -+ testVariationId String -+ testVariation TestVariation @relation(fields: [testVariationId], references: [id]) -+ updatedAt DateTime @updatedAt -+ createdAt DateTime @default(now()) -+} -+ -+model TestVariation { -+ id String @default(uuid()) @id -+ name String -+ browser String? -+ device String? -+ os String? -+ viewport String? -+ baselineName String? -+ ignoreAreas String @default("[]") -+ projectId String -+ project Project @relation(fields: [projectId], references: [id]) -+ testRuns TestRun[] -+ updatedAt DateTime @updatedAt -+ createdAt DateTime @default(now()) -+} -+ -+model User { -+ id String @default(uuid()) @id -+ 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 -+} -``` - - diff --git a/prisma/migrations/20200503001556-init/schema.prisma b/prisma/migrations/20200503001556-init/schema.prisma deleted file mode 100644 index 7a24e66d..00000000 --- a/prisma/migrations/20200503001556-init/schema.prisma +++ /dev/null @@ -1,83 +0,0 @@ -generator client { - provider = "prisma-client-js" -} - -datasource db { - provider = "postgresql" - url = "***" -} - -model Build { - id String @default(uuid()) @id - number Int? - branchName String? - status String? - testRuns TestRun[] - projectId String - project Project @relation(fields: [projectId], references: [id]) - // userId String - // user User @relation(fields: [userId], references: [id]) - updatedAt DateTime @updatedAt - createdAt DateTime @default(now()) -} - -model Project { - id String @default(uuid()) @id - name String - builds Build[] - testVariations TestVariation[] - updatedAt DateTime @updatedAt - createdAt DateTime @default(now()) -} - -model TestRun { - id String @default(uuid()) @id - imageName String - diffName String? - diffPercent Float? - diffTollerancePercent Float @default(1.0) - pixelMisMatchCount Int? - status TestStatus - buildId String - build Build @relation(fields: [buildId], references: [id]) - testVariationId String - testVariation TestVariation @relation(fields: [testVariationId], references: [id]) - updatedAt DateTime @updatedAt - createdAt DateTime @default(now()) -} - -model TestVariation { - id String @default(uuid()) @id - name String - browser String? - device String? - os String? - viewport String? - baselineName String? - ignoreAreas String @default("[]") - projectId String - project Project @relation(fields: [projectId], references: [id]) - testRuns TestRun[] - updatedAt DateTime @updatedAt - createdAt DateTime @default(now()) -} - -model User { - id String @default(uuid()) @id - 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 -} \ No newline at end of file diff --git a/prisma/migrations/20200503001556-init/steps.json b/prisma/migrations/20200503001556-init/steps.json deleted file mode 100644 index f6d1f0dc..00000000 --- a/prisma/migrations/20200503001556-init/steps.json +++ /dev/null @@ -1,1027 +0,0 @@ -{ - "version": "0.3.14-fixed", - "steps": [ - { - "tag": "CreateEnum", - "enum": "TestStatus", - "values": [ - "failed", - "new", - "ok", - "unresolved" - ] - }, - { - "tag": "CreateSource", - "source": "db" - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Source", - "source": "db" - }, - "argument": "provider", - "value": "\"postgresql\"" - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Source", - "source": "db" - }, - "argument": "url", - "value": "env(\"DATABASE_URL\")" - }, - { - "tag": "CreateModel", - "model": "Build" - }, - { - "tag": "CreateField", - "model": "Build", - "field": "id", - "type": "String", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Build", - "field": "id" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "Build", - "field": "id" - }, - "directive": "default" - }, - "argument": "", - "value": "uuid()" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Build", - "field": "id" - }, - "directive": "id" - } - }, - { - "tag": "CreateField", - "model": "Build", - "field": "number", - "type": "Int", - "arity": "Optional" - }, - { - "tag": "CreateField", - "model": "Build", - "field": "branchName", - "type": "String", - "arity": "Optional" - }, - { - "tag": "CreateField", - "model": "Build", - "field": "status", - "type": "String", - "arity": "Optional" - }, - { - "tag": "CreateField", - "model": "Build", - "field": "testRuns", - "type": "TestRun", - "arity": "List" - }, - { - "tag": "CreateField", - "model": "Build", - "field": "projectId", - "type": "String", - "arity": "Required" - }, - { - "tag": "CreateField", - "model": "Build", - "field": "project", - "type": "Project", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Build", - "field": "project" - }, - "directive": "relation" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "Build", - "field": "project" - }, - "directive": "relation" - }, - "argument": "fields", - "value": "[projectId]" - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "Build", - "field": "project" - }, - "directive": "relation" - }, - "argument": "references", - "value": "[id]" - }, - { - "tag": "CreateField", - "model": "Build", - "field": "updatedAt", - "type": "DateTime", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Build", - "field": "updatedAt" - }, - "directive": "updatedAt" - } - }, - { - "tag": "CreateField", - "model": "Build", - "field": "createdAt", - "type": "DateTime", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Build", - "field": "createdAt" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "Build", - "field": "createdAt" - }, - "directive": "default" - }, - "argument": "", - "value": "now()" - }, - { - "tag": "CreateModel", - "model": "Project" - }, - { - "tag": "CreateField", - "model": "Project", - "field": "id", - "type": "String", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Project", - "field": "id" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "Project", - "field": "id" - }, - "directive": "default" - }, - "argument": "", - "value": "uuid()" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Project", - "field": "id" - }, - "directive": "id" - } - }, - { - "tag": "CreateField", - "model": "Project", - "field": "name", - "type": "String", - "arity": "Required" - }, - { - "tag": "CreateField", - "model": "Project", - "field": "builds", - "type": "Build", - "arity": "List" - }, - { - "tag": "CreateField", - "model": "Project", - "field": "testVariations", - "type": "TestVariation", - "arity": "List" - }, - { - "tag": "CreateField", - "model": "Project", - "field": "updatedAt", - "type": "DateTime", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Project", - "field": "updatedAt" - }, - "directive": "updatedAt" - } - }, - { - "tag": "CreateField", - "model": "Project", - "field": "createdAt", - "type": "DateTime", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Project", - "field": "createdAt" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "Project", - "field": "createdAt" - }, - "directive": "default" - }, - "argument": "", - "value": "now()" - }, - { - "tag": "CreateModel", - "model": "TestRun" - }, - { - "tag": "CreateField", - "model": "TestRun", - "field": "id", - "type": "String", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "TestRun", - "field": "id" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "TestRun", - "field": "id" - }, - "directive": "default" - }, - "argument": "", - "value": "uuid()" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "TestRun", - "field": "id" - }, - "directive": "id" - } - }, - { - "tag": "CreateField", - "model": "TestRun", - "field": "imageName", - "type": "String", - "arity": "Required" - }, - { - "tag": "CreateField", - "model": "TestRun", - "field": "diffName", - "type": "String", - "arity": "Optional" - }, - { - "tag": "CreateField", - "model": "TestRun", - "field": "diffPercent", - "type": "Float", - "arity": "Optional" - }, - { - "tag": "CreateField", - "model": "TestRun", - "field": "diffTollerancePercent", - "type": "Float", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "TestRun", - "field": "diffTollerancePercent" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "TestRun", - "field": "diffTollerancePercent" - }, - "directive": "default" - }, - "argument": "", - "value": "1.0" - }, - { - "tag": "CreateField", - "model": "TestRun", - "field": "pixelMisMatchCount", - "type": "Int", - "arity": "Optional" - }, - { - "tag": "CreateField", - "model": "TestRun", - "field": "status", - "type": "TestStatus", - "arity": "Required" - }, - { - "tag": "CreateField", - "model": "TestRun", - "field": "buildId", - "type": "String", - "arity": "Required" - }, - { - "tag": "CreateField", - "model": "TestRun", - "field": "build", - "type": "Build", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "TestRun", - "field": "build" - }, - "directive": "relation" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "TestRun", - "field": "build" - }, - "directive": "relation" - }, - "argument": "fields", - "value": "[buildId]" - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "TestRun", - "field": "build" - }, - "directive": "relation" - }, - "argument": "references", - "value": "[id]" - }, - { - "tag": "CreateField", - "model": "TestRun", - "field": "testVariationId", - "type": "String", - "arity": "Required" - }, - { - "tag": "CreateField", - "model": "TestRun", - "field": "testVariation", - "type": "TestVariation", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "TestRun", - "field": "testVariation" - }, - "directive": "relation" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "TestRun", - "field": "testVariation" - }, - "directive": "relation" - }, - "argument": "fields", - "value": "[testVariationId]" - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "TestRun", - "field": "testVariation" - }, - "directive": "relation" - }, - "argument": "references", - "value": "[id]" - }, - { - "tag": "CreateField", - "model": "TestRun", - "field": "updatedAt", - "type": "DateTime", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "TestRun", - "field": "updatedAt" - }, - "directive": "updatedAt" - } - }, - { - "tag": "CreateField", - "model": "TestRun", - "field": "createdAt", - "type": "DateTime", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "TestRun", - "field": "createdAt" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "TestRun", - "field": "createdAt" - }, - "directive": "default" - }, - "argument": "", - "value": "now()" - }, - { - "tag": "CreateModel", - "model": "TestVariation" - }, - { - "tag": "CreateField", - "model": "TestVariation", - "field": "id", - "type": "String", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "TestVariation", - "field": "id" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "TestVariation", - "field": "id" - }, - "directive": "default" - }, - "argument": "", - "value": "uuid()" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "TestVariation", - "field": "id" - }, - "directive": "id" - } - }, - { - "tag": "CreateField", - "model": "TestVariation", - "field": "name", - "type": "String", - "arity": "Required" - }, - { - "tag": "CreateField", - "model": "TestVariation", - "field": "browser", - "type": "String", - "arity": "Optional" - }, - { - "tag": "CreateField", - "model": "TestVariation", - "field": "device", - "type": "String", - "arity": "Optional" - }, - { - "tag": "CreateField", - "model": "TestVariation", - "field": "os", - "type": "String", - "arity": "Optional" - }, - { - "tag": "CreateField", - "model": "TestVariation", - "field": "viewport", - "type": "String", - "arity": "Optional" - }, - { - "tag": "CreateField", - "model": "TestVariation", - "field": "baselineName", - "type": "String", - "arity": "Optional" - }, - { - "tag": "CreateField", - "model": "TestVariation", - "field": "ignoreAreas", - "type": "String", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "TestVariation", - "field": "ignoreAreas" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "TestVariation", - "field": "ignoreAreas" - }, - "directive": "default" - }, - "argument": "", - "value": "\"[]\"" - }, - { - "tag": "CreateField", - "model": "TestVariation", - "field": "projectId", - "type": "String", - "arity": "Required" - }, - { - "tag": "CreateField", - "model": "TestVariation", - "field": "project", - "type": "Project", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "TestVariation", - "field": "project" - }, - "directive": "relation" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "TestVariation", - "field": "project" - }, - "directive": "relation" - }, - "argument": "fields", - "value": "[projectId]" - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "TestVariation", - "field": "project" - }, - "directive": "relation" - }, - "argument": "references", - "value": "[id]" - }, - { - "tag": "CreateField", - "model": "TestVariation", - "field": "testRuns", - "type": "TestRun", - "arity": "List" - }, - { - "tag": "CreateField", - "model": "TestVariation", - "field": "updatedAt", - "type": "DateTime", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "TestVariation", - "field": "updatedAt" - }, - "directive": "updatedAt" - } - }, - { - "tag": "CreateField", - "model": "TestVariation", - "field": "createdAt", - "type": "DateTime", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "TestVariation", - "field": "createdAt" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "TestVariation", - "field": "createdAt" - }, - "directive": "default" - }, - "argument": "", - "value": "now()" - }, - { - "tag": "CreateModel", - "model": "User" - }, - { - "tag": "CreateField", - "model": "User", - "field": "id", - "type": "String", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "User", - "field": "id" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "User", - "field": "id" - }, - "directive": "default" - }, - "argument": "", - "value": "uuid()" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "User", - "field": "id" - }, - "directive": "id" - } - }, - { - "tag": "CreateField", - "model": "User", - "field": "email", - "type": "String", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "User", - "field": "email" - }, - "directive": "unique" - } - }, - { - "tag": "CreateField", - "model": "User", - "field": "password", - "type": "String", - "arity": "Required" - }, - { - "tag": "CreateField", - "model": "User", - "field": "firstName", - "type": "String", - "arity": "Optional" - }, - { - "tag": "CreateField", - "model": "User", - "field": "lastName", - "type": "String", - "arity": "Optional" - }, - { - "tag": "CreateField", - "model": "User", - "field": "apiKey", - "type": "String", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "User", - "field": "apiKey" - }, - "directive": "unique" - } - }, - { - "tag": "CreateField", - "model": "User", - "field": "isActive", - "type": "Boolean", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "User", - "field": "isActive" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "User", - "field": "isActive" - }, - "directive": "default" - }, - "argument": "", - "value": "true" - }, - { - "tag": "CreateField", - "model": "User", - "field": "builds", - "type": "Build", - "arity": "List" - }, - { - "tag": "CreateField", - "model": "User", - "field": "updatedAt", - "type": "DateTime", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "User", - "field": "updatedAt" - }, - "directive": "updatedAt" - } - }, - { - "tag": "CreateField", - "model": "User", - "field": "createdAt", - "type": "DateTime", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "User", - "field": "createdAt" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "User", - "field": "createdAt" - }, - "directive": "default" - }, - "argument": "", - "value": "now()" - } - ] -} \ No newline at end of file diff --git a/prisma/migrations/20200524162125-baseline-history/README.md b/prisma/migrations/20200524162125-baseline-history/README.md deleted file mode 100644 index 0f15cf76..00000000 --- a/prisma/migrations/20200524162125-baseline-history/README.md +++ /dev/null @@ -1,112 +0,0 @@ -# Migration `20200524162125-baseline-history` - -This migration has been generated by Pavel Strunkin at 5/24/2020, 4:21:25 PM. -You can check out the [state of the schema](./schema.prisma) after the migration. - -## Database Steps - -```sql -CREATE TABLE "public"."Baseline" ( -"baselineName" text NOT NULL ,"createdAt" timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,"id" text NOT NULL ,"testRunId" text ,"testVariationId" text NOT NULL ,"updatedAt" timestamp(3) NOT NULL , - PRIMARY KEY ("id")) - -ALTER TABLE "public"."TestRun" ADD COLUMN "baselineName" text , -ADD COLUMN "browser" text , -ADD COLUMN "device" text , -ADD COLUMN "ignoreAreas" text NOT NULL DEFAULT '[]', -ADD COLUMN "name" text NOT NULL DEFAULT '', -ADD COLUMN "os" text , -ADD COLUMN "viewport" text ; - -CREATE UNIQUE INDEX "Baseline_testRunId" ON "public"."Baseline"("testRunId") - -ALTER TABLE "public"."Baseline" ADD FOREIGN KEY ("testVariationId")REFERENCES "public"."TestVariation"("id") ON DELETE CASCADE ON UPDATE CASCADE - -ALTER TABLE "public"."Baseline" ADD FOREIGN KEY ("testRunId")REFERENCES "public"."TestRun"("id") ON DELETE SET NULL ON UPDATE CASCADE -``` - -## Changes - -```diff -diff --git schema.prisma schema.prisma -migration 20200503001556-init..20200524162125-baseline-history ---- datamodel.dml -+++ datamodel.dml -@@ -3,9 +3,9 @@ - } - datasource db { - provider = "postgresql" -- url = "***" -+ url = env("DATABASE_URL") - } - model Build { - id String @default(uuid()) @id -@@ -14,12 +14,12 @@ - status String? - testRuns TestRun[] - projectId String - project Project @relation(fields: [projectId], references: [id]) -- // userId String -- // 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 -@@ -43,26 +43,48 @@ - testVariationId String - testVariation TestVariation @relation(fields: [testVariationId], references: [id]) - 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("[]") -+ // Baseline -+ baseline Baseline? - } - model TestVariation { -- id String @default(uuid()) @id -+ id String @default(uuid()) @id - name String - browser String? - device String? - os String? - viewport String? - baselineName String? -- ignoreAreas String @default("[]") -+ ignoreAreas String @default("[]") - projectId String -- project Project @relation(fields: [projectId], references: [id]) -+ project Project @relation(fields: [projectId], references: [id]) - testRuns TestRun[] -- updatedAt DateTime @updatedAt -- createdAt DateTime @default(now()) -+ baselines Baseline[] -+ updatedAt DateTime @updatedAt -+ createdAt DateTime @default(now()) - } -+model Baseline { -+ id String @default(uuid()) @id -+ 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 @default(uuid()) @id - email String @unique - password String -``` - - diff --git a/prisma/migrations/20200524162125-baseline-history/schema.prisma b/prisma/migrations/20200524162125-baseline-history/schema.prisma deleted file mode 100644 index 9d436c64..00000000 --- a/prisma/migrations/20200524162125-baseline-history/schema.prisma +++ /dev/null @@ -1,105 +0,0 @@ -generator client { - provider = "prisma-client-js" -} - -datasource db { - provider = "postgresql" - url = "***" -} - -model Build { - id String @default(uuid()) @id - 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? -} - -model Project { - id String @default(uuid()) @id - name String - builds Build[] - testVariations TestVariation[] - updatedAt DateTime @updatedAt - createdAt DateTime @default(now()) -} - -model TestRun { - id String @default(uuid()) @id - imageName String - diffName String? - diffPercent Float? - diffTollerancePercent Float @default(1.0) - pixelMisMatchCount Int? - status TestStatus - buildId String - build Build @relation(fields: [buildId], references: [id]) - testVariationId String - testVariation TestVariation @relation(fields: [testVariationId], references: [id]) - 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("[]") - // Baseline - baseline Baseline? -} - -model TestVariation { - id String @default(uuid()) @id - name String - 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[] - updatedAt DateTime @updatedAt - createdAt DateTime @default(now()) -} - -model Baseline { - id String @default(uuid()) @id - 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 @default(uuid()) @id - 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 -} \ No newline at end of file diff --git a/prisma/migrations/20200524162125-baseline-history/steps.json b/prisma/migrations/20200524162125-baseline-history/steps.json deleted file mode 100644 index 0f5e22e1..00000000 --- a/prisma/migrations/20200524162125-baseline-history/steps.json +++ /dev/null @@ -1,381 +0,0 @@ -{ - "version": "0.3.14-fixed", - "steps": [ - { - "tag": "CreateModel", - "model": "Baseline" - }, - { - "tag": "CreateField", - "model": "Baseline", - "field": "id", - "type": "String", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Baseline", - "field": "id" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "Baseline", - "field": "id" - }, - "directive": "default" - }, - "argument": "", - "value": "uuid()" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Baseline", - "field": "id" - }, - "directive": "id" - } - }, - { - "tag": "CreateField", - "model": "Baseline", - "field": "baselineName", - "type": "String", - "arity": "Required" - }, - { - "tag": "CreateField", - "model": "Baseline", - "field": "testVariationId", - "type": "String", - "arity": "Required" - }, - { - "tag": "CreateField", - "model": "Baseline", - "field": "testVariation", - "type": "TestVariation", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Baseline", - "field": "testVariation" - }, - "directive": "relation" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "Baseline", - "field": "testVariation" - }, - "directive": "relation" - }, - "argument": "fields", - "value": "[testVariationId]" - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "Baseline", - "field": "testVariation" - }, - "directive": "relation" - }, - "argument": "references", - "value": "[id]" - }, - { - "tag": "CreateField", - "model": "Baseline", - "field": "testRunId", - "type": "String", - "arity": "Optional" - }, - { - "tag": "CreateField", - "model": "Baseline", - "field": "testRun", - "type": "TestRun", - "arity": "Optional" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Baseline", - "field": "testRun" - }, - "directive": "relation" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "Baseline", - "field": "testRun" - }, - "directive": "relation" - }, - "argument": "fields", - "value": "[testRunId]" - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "Baseline", - "field": "testRun" - }, - "directive": "relation" - }, - "argument": "references", - "value": "[id]" - }, - { - "tag": "CreateField", - "model": "Baseline", - "field": "updatedAt", - "type": "DateTime", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Baseline", - "field": "updatedAt" - }, - "directive": "updatedAt" - } - }, - { - "tag": "CreateField", - "model": "Baseline", - "field": "createdAt", - "type": "DateTime", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Baseline", - "field": "createdAt" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "Baseline", - "field": "createdAt" - }, - "directive": "default" - }, - "argument": "", - "value": "now()" - }, - { - "tag": "CreateField", - "model": "Build", - "field": "user", - "type": "User", - "arity": "Optional" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Build", - "field": "user" - }, - "directive": "relation" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "Build", - "field": "user" - }, - "directive": "relation" - }, - "argument": "fields", - "value": "[userId]" - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "Build", - "field": "user" - }, - "directive": "relation" - }, - "argument": "references", - "value": "[id]" - }, - { - "tag": "CreateField", - "model": "Build", - "field": "userId", - "type": "String", - "arity": "Optional" - }, - { - "tag": "CreateField", - "model": "TestRun", - "field": "name", - "type": "String", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "TestRun", - "field": "name" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "TestRun", - "field": "name" - }, - "directive": "default" - }, - "argument": "", - "value": "\"\"" - }, - { - "tag": "CreateField", - "model": "TestRun", - "field": "browser", - "type": "String", - "arity": "Optional" - }, - { - "tag": "CreateField", - "model": "TestRun", - "field": "device", - "type": "String", - "arity": "Optional" - }, - { - "tag": "CreateField", - "model": "TestRun", - "field": "os", - "type": "String", - "arity": "Optional" - }, - { - "tag": "CreateField", - "model": "TestRun", - "field": "viewport", - "type": "String", - "arity": "Optional" - }, - { - "tag": "CreateField", - "model": "TestRun", - "field": "baselineName", - "type": "String", - "arity": "Optional" - }, - { - "tag": "CreateField", - "model": "TestRun", - "field": "ignoreAreas", - "type": "String", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "TestRun", - "field": "ignoreAreas" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "TestRun", - "field": "ignoreAreas" - }, - "directive": "default" - }, - "argument": "", - "value": "\"[]\"" - }, - { - "tag": "CreateField", - "model": "TestRun", - "field": "baseline", - "type": "Baseline", - "arity": "Optional" - }, - { - "tag": "CreateField", - "model": "TestVariation", - "field": "baselines", - "type": "Baseline", - "arity": "List" - } - ] -} \ No newline at end of file diff --git a/prisma/migrations/20200526195312-approved-test-status-added/README.md b/prisma/migrations/20200526195312-approved-test-status-added/README.md deleted file mode 100644 index b5d53eae..00000000 --- a/prisma/migrations/20200526195312-approved-test-status-added/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# Migration `20200526195312-approved-test-status-added` - -This migration has been generated by Pavel Strunkin at 5/26/2020, 7:53:12 PM. -You can check out the [state of the schema](./schema.prisma) after the migration. - -## Database Steps - -```sql -ALTER TYPE "TestStatus" ADD VALUE 'approved' -``` - -## Changes - -```diff -diff --git schema.prisma schema.prisma -migration 20200524162125-baseline-history..20200526195312-approved-test-status-added ---- datamodel.dml -+++ datamodel.dml -@@ -3,9 +3,9 @@ - } - datasource db { - provider = "postgresql" -- url = "***" -+ url = env("DATABASE_URL") - } - model Build { - id String @default(uuid()) @id -@@ -101,5 +101,6 @@ - failed - new - ok - unresolved -+ approved - } -``` - - diff --git a/prisma/migrations/20200526195312-approved-test-status-added/schema.prisma b/prisma/migrations/20200526195312-approved-test-status-added/schema.prisma deleted file mode 100644 index b61242f5..00000000 --- a/prisma/migrations/20200526195312-approved-test-status-added/schema.prisma +++ /dev/null @@ -1,106 +0,0 @@ -generator client { - provider = "prisma-client-js" -} - -datasource db { - provider = "postgresql" - url = "***" -} - -model Build { - id String @default(uuid()) @id - 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? -} - -model Project { - id String @default(uuid()) @id - name String - builds Build[] - testVariations TestVariation[] - updatedAt DateTime @updatedAt - createdAt DateTime @default(now()) -} - -model TestRun { - id String @default(uuid()) @id - imageName String - diffName String? - diffPercent Float? - diffTollerancePercent Float @default(1.0) - pixelMisMatchCount Int? - status TestStatus - buildId String - build Build @relation(fields: [buildId], references: [id]) - testVariationId String - testVariation TestVariation @relation(fields: [testVariationId], references: [id]) - 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("[]") - // Baseline - baseline Baseline? -} - -model TestVariation { - id String @default(uuid()) @id - name String - 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[] - updatedAt DateTime @updatedAt - createdAt DateTime @default(now()) -} - -model Baseline { - id String @default(uuid()) @id - 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 @default(uuid()) @id - 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 -} \ No newline at end of file diff --git a/prisma/migrations/20200526195312-approved-test-status-added/steps.json b/prisma/migrations/20200526195312-approved-test-status-added/steps.json deleted file mode 100644 index 97784c30..00000000 --- a/prisma/migrations/20200526195312-approved-test-status-added/steps.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "version": "0.3.14-fixed", - "steps": [ - { - "tag": "UpdateEnum", - "enum": "TestStatus", - "createdValues": [ - "approved" - ] - } - ] -} \ No newline at end of file diff --git a/prisma/migrations/20200627134248-comment-added/README.md b/prisma/migrations/20200627134248-comment-added/README.md deleted file mode 100644 index f7244920..00000000 --- a/prisma/migrations/20200627134248-comment-added/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# Migration `20200627134248-comment-added` - -This migration has been generated by Pavel Strunkin at 6/27/2020, 1:42:48 PM. -You can check out the [state of the schema](./schema.prisma) after the migration. - -## Database Steps - -```sql -ALTER TABLE "public"."TestRun" ADD COLUMN "comment" text ; - -ALTER TABLE "public"."TestVariation" ADD COLUMN "comment" text ; -``` - -## Changes - -```diff -diff --git schema.prisma schema.prisma -migration 20200526195312-approved-test-status-added..20200627134248-comment-added ---- datamodel.dml -+++ datamodel.dml -@@ -3,9 +3,9 @@ - } - datasource db { - provider = "postgresql" -- url = "***" -+ url = env("DATABASE_URL") - } - model Build { - id String @default(uuid()) @id -@@ -51,9 +51,9 @@ - os String? - viewport String? - baselineName String? - ignoreAreas String @default("[]") -- // Baseline -+ comment String? - baseline Baseline? - } - model TestVariation { -@@ -68,8 +68,9 @@ - projectId String - project Project @relation(fields: [projectId], references: [id]) - testRuns TestRun[] - baselines Baseline[] -+ comment String? - updatedAt DateTime @updatedAt - createdAt DateTime @default(now()) - } -@@ -102,5 +103,5 @@ - new - ok - unresolved - approved --} -+} -``` - - diff --git a/prisma/migrations/20200627134248-comment-added/schema.prisma b/prisma/migrations/20200627134248-comment-added/schema.prisma deleted file mode 100644 index bea33676..00000000 --- a/prisma/migrations/20200627134248-comment-added/schema.prisma +++ /dev/null @@ -1,107 +0,0 @@ -generator client { - provider = "prisma-client-js" -} - -datasource db { - provider = "postgresql" - url = "***" -} - -model Build { - id String @default(uuid()) @id - 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? -} - -model Project { - id String @default(uuid()) @id - name String - builds Build[] - testVariations TestVariation[] - updatedAt DateTime @updatedAt - createdAt DateTime @default(now()) -} - -model TestRun { - id String @default(uuid()) @id - imageName String - diffName String? - diffPercent Float? - diffTollerancePercent Float @default(1.0) - pixelMisMatchCount Int? - status TestStatus - buildId String - build Build @relation(fields: [buildId], references: [id]) - testVariationId String - testVariation TestVariation @relation(fields: [testVariationId], references: [id]) - 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? -} - -model TestVariation { - id String @default(uuid()) @id - name String - 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()) -} - -model Baseline { - id String @default(uuid()) @id - 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 @default(uuid()) @id - 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 -} diff --git a/prisma/migrations/20200627134248-comment-added/steps.json b/prisma/migrations/20200627134248-comment-added/steps.json deleted file mode 100644 index 83e518f1..00000000 --- a/prisma/migrations/20200627134248-comment-added/steps.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "version": "0.3.14-fixed", - "steps": [ - { - "tag": "CreateField", - "model": "TestRun", - "field": "comment", - "type": "String", - "arity": "Optional" - }, - { - "tag": "CreateField", - "model": "TestVariation", - "field": "comment", - "type": "String", - "arity": "Optional" - } - ] -} \ No newline at end of file diff --git a/prisma/migrations/20200707182652-project-name-unique-constraint/README.md b/prisma/migrations/20200707182652-project-name-unique-constraint/README.md deleted file mode 100644 index b2248036..00000000 --- a/prisma/migrations/20200707182652-project-name-unique-constraint/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# Migration `20200707182652-project-name-unique-constraint` - -This migration has been generated by Pavel Strunkin at 7/7/2020, 6:26:52 PM. -You can check out the [state of the schema](./schema.prisma) after the migration. - -## Database Steps - -```sql -CREATE UNIQUE INDEX "Project.name" ON "public"."Project"("name") -``` - -## Changes - -```diff -diff --git schema.prisma schema.prisma -migration 20200627134248-comment-added..20200707182652-project-name-unique-constraint ---- datamodel.dml -+++ datamodel.dml -@@ -3,9 +3,9 @@ - } - datasource db { - provider = "postgresql" -- url = "***" -+ url = env("DATABASE_URL") - } - model Build { - id String @default(uuid()) @id -@@ -27,8 +27,10 @@ - builds Build[] - testVariations TestVariation[] - updatedAt DateTime @updatedAt - createdAt DateTime @default(now()) -+ -+ @@unique([name]) - } - model TestRun { - id String @default(uuid()) @id -``` - - diff --git a/prisma/migrations/20200707182652-project-name-unique-constraint/schema.prisma b/prisma/migrations/20200707182652-project-name-unique-constraint/schema.prisma deleted file mode 100644 index ff8e18e3..00000000 --- a/prisma/migrations/20200707182652-project-name-unique-constraint/schema.prisma +++ /dev/null @@ -1,109 +0,0 @@ -generator client { - provider = "prisma-client-js" -} - -datasource db { - provider = "postgresql" - url = "***" -} - -model Build { - id String @default(uuid()) @id - 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? -} - -model Project { - id String @default(uuid()) @id - name String - builds Build[] - testVariations TestVariation[] - updatedAt DateTime @updatedAt - createdAt DateTime @default(now()) - - @@unique([name]) -} - -model TestRun { - id String @default(uuid()) @id - imageName String - diffName String? - diffPercent Float? - diffTollerancePercent Float @default(1.0) - pixelMisMatchCount Int? - status TestStatus - buildId String - build Build @relation(fields: [buildId], references: [id]) - testVariationId String - testVariation TestVariation @relation(fields: [testVariationId], references: [id]) - 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? -} - -model TestVariation { - id String @default(uuid()) @id - name String - 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()) -} - -model Baseline { - id String @default(uuid()) @id - 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 @default(uuid()) @id - 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 -} diff --git a/prisma/migrations/20200707182652-project-name-unique-constraint/steps.json b/prisma/migrations/20200707182652-project-name-unique-constraint/steps.json deleted file mode 100644 index ae2b07d9..00000000 --- a/prisma/migrations/20200707182652-project-name-unique-constraint/steps.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "version": "0.3.14-fixed", - "steps": [ - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Model", - "model": "Project", - "arguments": [ - { - "name": "", - "value": "[name]" - } - ] - }, - "directive": "unique" - } - } - ] -} \ No newline at end of file diff --git a/prisma/migrations/20200715232608-branch-strategy/README.md b/prisma/migrations/20200715232608-branch-strategy/README.md deleted file mode 100644 index b50ba188..00000000 --- a/prisma/migrations/20200715232608-branch-strategy/README.md +++ /dev/null @@ -1,75 +0,0 @@ -# Migration `20200715232608-branch-strategy` - -This migration has been generated by Pavel Strunkin at 7/15/2020, 11:26:08 PM. -You can check out the [state of the schema](./schema.prisma) after the migration. - -## Database Steps - -```sql -CREATE UNIQUE INDEX "TestVariation.name_browser_device_os_viewport_branchName" ON "public"."TestVariation"("name","browser","device","os","viewport","branchName") -``` - -## Changes - -```diff -diff --git schema.prisma schema.prisma -migration 20200707182652-project-name-unique-constraint..20200715232608-branch-strategy ---- datamodel.dml -+++ datamodel.dml -@@ -3,9 +3,9 @@ - } - datasource db { - provider = "postgresql" -- url = "***" -+ url = "***" - } - model Build { - id String @default(uuid()) @id -@@ -23,8 +23,9 @@ - model Project { - id String @default(uuid()) @id - name String -+ mainBranchName String @default("master") - builds Build[] - testVariations TestVariation[] - updatedAt DateTime @updatedAt - createdAt DateTime @default(now()) -@@ -43,8 +44,9 @@ - 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("") -@@ -55,13 +57,16 @@ - baselineName String? - ignoreAreas String @default("[]") - comment String? - baseline Baseline? -+ branchName String @default("master") -+ baselineBranchName String? - } - model TestVariation { - id String @default(uuid()) @id - name String -+ branchName String @default("master") - browser String? - device String? - os String? - viewport String? -@@ -73,8 +78,10 @@ - baselines Baseline[] - comment String? - updatedAt DateTime @updatedAt - createdAt DateTime @default(now()) -+ -+ @@unique([name, browser, device, os, viewport, branchName]) - } - model Baseline { - id String @default(uuid()) @id -``` - - diff --git a/prisma/migrations/20200715232608-branch-strategy/schema.prisma b/prisma/migrations/20200715232608-branch-strategy/schema.prisma deleted file mode 100644 index aaaed347..00000000 --- a/prisma/migrations/20200715232608-branch-strategy/schema.prisma +++ /dev/null @@ -1,116 +0,0 @@ -generator client { - provider = "prisma-client-js" -} - -datasource db { - provider = "postgresql" - url = "***" -} - -model Build { - id String @default(uuid()) @id - 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? -} - -model Project { - id String @default(uuid()) @id - name String - mainBranchName String @default("master") - builds Build[] - testVariations TestVariation[] - updatedAt DateTime @updatedAt - createdAt DateTime @default(now()) - - @@unique([name]) -} - -model TestRun { - id String @default(uuid()) @id - imageName String - diffName String? - diffPercent Float? - diffTollerancePercent Float @default(1.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 @default(uuid()) @id - 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([name, browser, device, os, viewport, branchName]) -} - -model Baseline { - id String @default(uuid()) @id - 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 @default(uuid()) @id - 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 -} diff --git a/prisma/migrations/20200715232608-branch-strategy/steps.json b/prisma/migrations/20200715232608-branch-strategy/steps.json deleted file mode 100644 index 8260e776..00000000 --- a/prisma/migrations/20200715232608-branch-strategy/steps.json +++ /dev/null @@ -1,156 +0,0 @@ -{ - "version": "0.3.14-fixed", - "steps": [ - { - "tag": "CreateField", - "model": "Project", - "field": "mainBranchName", - "type": "String", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Project", - "field": "mainBranchName" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "Project", - "field": "mainBranchName" - }, - "directive": "default" - }, - "argument": "", - "value": "\"master\"" - }, - { - "tag": "CreateField", - "model": "TestRun", - "field": "merge", - "type": "Boolean", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "TestRun", - "field": "merge" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "TestRun", - "field": "merge" - }, - "directive": "default" - }, - "argument": "", - "value": "false" - }, - { - "tag": "CreateField", - "model": "TestRun", - "field": "branchName", - "type": "String", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "TestRun", - "field": "branchName" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "TestRun", - "field": "branchName" - }, - "directive": "default" - }, - "argument": "", - "value": "\"master\"" - }, - { - "tag": "CreateField", - "model": "TestRun", - "field": "baselineBranchName", - "type": "String", - "arity": "Optional" - }, - { - "tag": "CreateField", - "model": "TestVariation", - "field": "branchName", - "type": "String", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "TestVariation", - "field": "branchName" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "TestVariation", - "field": "branchName" - }, - "directive": "default" - }, - "argument": "", - "value": "\"master\"" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Model", - "model": "TestVariation", - "arguments": [ - { - "name": "", - "value": "[name, browser, device, os, viewport, branchName]" - } - ] - }, - "directive": "unique" - } - } - ] -} \ No newline at end of file diff --git a/prisma/migrations/20200728221159-zero-diff-tolerance/README.md b/prisma/migrations/20200728221159-zero-diff-tolerance/README.md deleted file mode 100644 index 70b7fbbd..00000000 --- a/prisma/migrations/20200728221159-zero-diff-tolerance/README.md +++ /dev/null @@ -1,41 +0,0 @@ -# Migration `20200728221159-zero-diff-tolerance` - -This migration has been generated by Pavel Strunkin at 7/28/2020, 10:12:00 PM. -You can check out the [state of the schema](./schema.prisma) after the migration. - -## Database Steps - -```sql -ALTER TABLE "public"."TestRun" ALTER COLUMN "diffTollerancePercent" SET DEFAULT 0; -``` - -## Changes - -```diff -diff --git schema.prisma schema.prisma -migration 20200715232608-branch-strategy..20200728221159-zero-diff-tolerance ---- datamodel.dml -+++ datamodel.dml -@@ -3,9 +3,9 @@ - } - datasource db { - provider = "postgresql" -- url = "***" -+ url = "***" - } - model Build { - id String @default(uuid()) @id -@@ -37,9 +37,9 @@ - id String @default(uuid()) @id - imageName String - diffName String? - diffPercent Float? -- diffTollerancePercent Float @default(1.0) -+ diffTollerancePercent Float @default(0) - pixelMisMatchCount Int? - status TestStatus - buildId String - build Build @relation(fields: [buildId], references: [id]) -``` - - diff --git a/prisma/migrations/20200728221159-zero-diff-tolerance/schema.prisma b/prisma/migrations/20200728221159-zero-diff-tolerance/schema.prisma deleted file mode 100644 index 95cc207a..00000000 --- a/prisma/migrations/20200728221159-zero-diff-tolerance/schema.prisma +++ /dev/null @@ -1,116 +0,0 @@ -generator client { - provider = "prisma-client-js" -} - -datasource db { - provider = "postgresql" - url = "***" -} - -model Build { - id String @default(uuid()) @id - 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? -} - -model Project { - id String @default(uuid()) @id - name String - mainBranchName String @default("master") - builds Build[] - testVariations TestVariation[] - updatedAt DateTime @updatedAt - createdAt DateTime @default(now()) - - @@unique([name]) -} - -model TestRun { - id String @default(uuid()) @id - 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 @default(uuid()) @id - 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([name, browser, device, os, viewport, branchName]) -} - -model Baseline { - id String @default(uuid()) @id - 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 @default(uuid()) @id - 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 -} diff --git a/prisma/migrations/20200728221159-zero-diff-tolerance/steps.json b/prisma/migrations/20200728221159-zero-diff-tolerance/steps.json deleted file mode 100644 index f3ae2968..00000000 --- a/prisma/migrations/20200728221159-zero-diff-tolerance/steps.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "version": "0.3.14-fixed", - "steps": [ - { - "tag": "UpdateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "TestRun", - "field": "diffTollerancePercent" - }, - "directive": "default" - }, - "argument": "", - "newValue": "0" - } - ] -} \ No newline at end of file diff --git a/prisma/migrations/20200812213545-build-run-status/README.md b/prisma/migrations/20200812213545-build-run-status/README.md deleted file mode 100644 index 3d142f5b..00000000 --- a/prisma/migrations/20200812213545-build-run-status/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# Migration `20200812213545-build-run-status` - -This migration has been generated by Pavel Strunkin at 8/12/2020, 9:35:45 PM. -You can check out the [state of the schema](./schema.prisma) after the migration. - -## Database Steps - -```sql -ALTER TABLE "public"."Build" ADD COLUMN "isRunning" boolean ; -``` - -## Changes - -```diff -diff --git schema.prisma schema.prisma -migration 20200728221159-zero-diff-tolerance..20200812213545-build-run-status ---- datamodel.dml -+++ datamodel.dml -@@ -3,9 +3,9 @@ - } - datasource db { - provider = "postgresql" -- url = "***" -+ url = "***" - } - model Build { - id String @default(uuid()) @id -@@ -18,8 +18,9 @@ - updatedAt DateTime @updatedAt - createdAt DateTime @default(now()) - user User? @relation(fields: [userId], references: [id]) - userId String? -+ isRunning Boolean? - } - model Project { - id String @default(uuid()) @id -``` - - diff --git a/prisma/migrations/20200812213545-build-run-status/schema.prisma b/prisma/migrations/20200812213545-build-run-status/schema.prisma deleted file mode 100644 index 264cbfba..00000000 --- a/prisma/migrations/20200812213545-build-run-status/schema.prisma +++ /dev/null @@ -1,117 +0,0 @@ -generator client { - provider = "prisma-client-js" -} - -datasource db { - provider = "postgresql" - url = "***" -} - -model Build { - id String @default(uuid()) @id - 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 @default(uuid()) @id - name String - mainBranchName String @default("master") - builds Build[] - testVariations TestVariation[] - updatedAt DateTime @updatedAt - createdAt DateTime @default(now()) - - @@unique([name]) -} - -model TestRun { - id String @default(uuid()) @id - 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 @default(uuid()) @id - 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([name, browser, device, os, viewport, branchName]) -} - -model Baseline { - id String @default(uuid()) @id - 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 @default(uuid()) @id - 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 -} diff --git a/prisma/migrations/20200812213545-build-run-status/steps.json b/prisma/migrations/20200812213545-build-run-status/steps.json deleted file mode 100644 index 239a04e5..00000000 --- a/prisma/migrations/20200812213545-build-run-status/steps.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "version": "0.3.14-fixed", - "steps": [ - { - "tag": "CreateField", - "model": "Build", - "field": "isRunning", - "type": "Boolean", - "arity": "Optional" - } - ] -} \ No newline at end of file diff --git a/prisma/migrations/20200909223305-test-variation-project-id-added-into-unique-constraint/README.md b/prisma/migrations/20200909223305-test-variation-project-id-added-into-unique-constraint/README.md deleted file mode 100644 index 97a150bb..00000000 --- a/prisma/migrations/20200909223305-test-variation-project-id-added-into-unique-constraint/README.md +++ /dev/null @@ -1,41 +0,0 @@ -# Migration `20200909223305-test-variation-project-id-added-into-unique-constraint` - -This migration has been generated by Pavel Strunkin at 9/10/2020, 12:33:05 AM. -You can check out the [state of the schema](./schema.prisma) after the migration. - -## Database Steps - -```sql -DROP INDEX "public"."TestVariation.name_browser_device_os_viewport_branchName_unique" - -CREATE UNIQUE INDEX "TestVariation.projectId_name_browser_device_os_viewport_branchName_unique" ON "public"."TestVariation"("projectId","name","browser","device","os","viewport","branchName") -``` - -## Changes - -```diff -diff --git schema.prisma schema.prisma -migration 20200812213545-build-run-status..20200909223305-test-variation-project-id-added-into-unique-constraint ---- datamodel.dml -+++ datamodel.dml -@@ -3,9 +3,9 @@ - } - datasource db { - provider = "postgresql" -- url = "***" -+ url = "***" - } - model Build { - id String @default(uuid()) @id -@@ -80,9 +80,9 @@ - comment String? - updatedAt DateTime @updatedAt - createdAt DateTime @default(now()) -- @@unique([name, browser, device, os, viewport, branchName]) -+ @@unique([projectId, name, browser, device, os, viewport, branchName]) - } - model Baseline { - id String @default(uuid()) @id -``` - - diff --git a/prisma/migrations/20200909223305-test-variation-project-id-added-into-unique-constraint/schema.prisma b/prisma/migrations/20200909223305-test-variation-project-id-added-into-unique-constraint/schema.prisma deleted file mode 100644 index 2430254d..00000000 --- a/prisma/migrations/20200909223305-test-variation-project-id-added-into-unique-constraint/schema.prisma +++ /dev/null @@ -1,117 +0,0 @@ -generator client { - provider = "prisma-client-js" -} - -datasource db { - provider = "postgresql" - url = "***" -} - -model Build { - id String @default(uuid()) @id - 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 @default(uuid()) @id - name String - mainBranchName String @default("master") - builds Build[] - testVariations TestVariation[] - updatedAt DateTime @updatedAt - createdAt DateTime @default(now()) - - @@unique([name]) -} - -model TestRun { - id String @default(uuid()) @id - 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 @default(uuid()) @id - 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 @default(uuid()) @id - 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 @default(uuid()) @id - 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 -} diff --git a/prisma/migrations/20200909223305-test-variation-project-id-added-into-unique-constraint/steps.json b/prisma/migrations/20200909223305-test-variation-project-id-added-into-unique-constraint/steps.json deleted file mode 100644 index f089fa2a..00000000 --- a/prisma/migrations/20200909223305-test-variation-project-id-added-into-unique-constraint/steps.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "version": "0.3.14-fixed", - "steps": [ - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Model", - "model": "TestVariation", - "arguments": [ - { - "name": "", - "value": "[projectId, name, browser, device, os, viewport, branchName]" - } - ] - }, - "directive": "unique" - } - }, - { - "tag": "DeleteDirective", - "location": { - "path": { - "tag": "Model", - "model": "TestVariation", - "arguments": [ - { - "name": "", - "value": "[name, browser, device, os, viewport, branchName]" - } - ] - }, - "directive": "unique" - } - } - ] -} \ No newline at end of file diff --git a/prisma/migrations/20201007145002-builds-counter/README.md b/prisma/migrations/20201007145002-builds-counter/README.md deleted file mode 100644 index 139cb517..00000000 --- a/prisma/migrations/20201007145002-builds-counter/README.md +++ /dev/null @@ -1,91 +0,0 @@ -# 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? -``` - - diff --git a/prisma/migrations/20201007145002-builds-counter/schema.prisma b/prisma/migrations/20201007145002-builds-counter/schema.prisma deleted file mode 100644 index 46e0624f..00000000 --- a/prisma/migrations/20201007145002-builds-counter/schema.prisma +++ /dev/null @@ -1,119 +0,0 @@ -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 -} diff --git a/prisma/migrations/20201007145002-builds-counter/steps.json b/prisma/migrations/20201007145002-builds-counter/steps.json deleted file mode 100644 index f42782aa..00000000 --- a/prisma/migrations/20201007145002-builds-counter/steps.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "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" - } - ] -} \ No newline at end of file diff --git a/prisma/migrations/20201115155739-ci-build-id-added/README.md b/prisma/migrations/20201115155739-ci-build-id-added/README.md deleted file mode 100644 index 7e797dbc..00000000 --- a/prisma/migrations/20201115155739-ci-build-id-added/README.md +++ /dev/null @@ -1,42 +0,0 @@ -# Migration `20201115155739-ci-build-id-added` - -This migration has been generated by Pavel Strunkin at 11/15/2020, 5:57:39 PM. -You can check out the [state of the schema](./schema.prisma) after the migration. - -## Database Steps - -```sql -ALTER TABLE "public"."Build" ADD COLUMN "ciBuildId" text - -CREATE UNIQUE INDEX "Build.ciBuildId_unique" ON "public"."Build"("ciBuildId") -``` - -## Changes - -```diff -diff --git schema.prisma schema.prisma -migration 20201007145002-builds-counter..20201115155739-ci-build-id-added ---- datamodel.dml -+++ datamodel.dml -@@ -1,16 +1,17 @@ - generator client { -- provider = "prisma-client-js" -+ provider = "prisma-client-js" - previewFeatures = ["atomicNumberOperations"] - } - datasource db { -- provider = "postgresql" -- url = "***" -+ provider = "postgresql" -+ url = "***" - } - model Build { - id String @id @default(uuid()) -+ ciBuildId String? @unique - number Int? - branchName String? - status String? - testRuns TestRun[] -``` - - diff --git a/prisma/migrations/20201115155739-ci-build-id-added/schema.prisma b/prisma/migrations/20201115155739-ci-build-id-added/schema.prisma deleted file mode 100644 index 01b6e22e..00000000 --- a/prisma/migrations/20201115155739-ci-build-id-added/schema.prisma +++ /dev/null @@ -1,120 +0,0 @@ -generator client { - provider = "prisma-client-js" - previewFeatures = ["atomicNumberOperations"] -} - -datasource db { - provider = "postgresql" - url = "***" -} - -model Build { - id String @id @default(uuid()) - ciBuildId String? @unique - 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 -} diff --git a/prisma/migrations/20201115155739-ci-build-id-added/steps.json b/prisma/migrations/20201115155739-ci-build-id-added/steps.json deleted file mode 100644 index 83924d01..00000000 --- a/prisma/migrations/20201115155739-ci-build-id-added/steps.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "version": "0.3.14-fixed", - "steps": [ - { - "tag": "CreateField", - "model": "Build", - "field": "ciBuildId", - "type": "String", - "arity": "Optional" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Build", - "field": "ciBuildId" - }, - "directive": "unique" - } - } - ] -} \ No newline at end of file diff --git a/prisma/migrations/20201201211711-test-run--temp-ignore-areas-added/README.md b/prisma/migrations/20201201211711-test-run--temp-ignore-areas-added/README.md deleted file mode 100644 index 3b0fdc0f..00000000 --- a/prisma/migrations/20201201211711-test-run--temp-ignore-areas-added/README.md +++ /dev/null @@ -1,45 +0,0 @@ -# Migration `20201201211711-test-run--temp-ignore-areas-added` - -This migration has been generated by Pavel Strunkin at 12/1/2020, 11:17:11 PM. -You can check out the [state of the schema](./schema.prisma) after the migration. - -## Database Steps - -```sql -ALTER TABLE "public"."TestRun" ADD COLUMN "tempIgnoreAreas" text NOT NULL DEFAULT E'[]' -``` - -## Changes - -```diff -diff --git schema.prisma schema.prisma -migration 20201115155739-ci-build-id-added..20201201211711-test-run--temp-ignore-areas-added ---- datamodel.dml -+++ datamodel.dml -@@ -4,9 +4,9 @@ - } - datasource db { - provider = "postgresql" -- url = "***" -+ url = "***" - } - model Build { - id String @id @default(uuid()) -@@ -58,13 +58,14 @@ - device String? - os String? - viewport String? - baselineName String? -- ignoreAreas String @default("[]") - comment String? - baseline Baseline? - branchName String @default("master") - baselineBranchName String? -+ ignoreAreas String @default("[]") -+ tempIgnoreAreas String @default("[]") - } - model TestVariation { - id String @id @default(uuid()) -``` - - diff --git a/prisma/migrations/20201201211711-test-run--temp-ignore-areas-added/schema.prisma b/prisma/migrations/20201201211711-test-run--temp-ignore-areas-added/schema.prisma deleted file mode 100644 index 19c416fa..00000000 --- a/prisma/migrations/20201201211711-test-run--temp-ignore-areas-added/schema.prisma +++ /dev/null @@ -1,121 +0,0 @@ -generator client { - provider = "prisma-client-js" - previewFeatures = ["atomicNumberOperations"] -} - -datasource db { - provider = "postgresql" - url = "***" -} - -model Build { - id String @id @default(uuid()) - ciBuildId String? @unique - 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? - comment String? - baseline Baseline? - branchName String @default("master") - baselineBranchName String? - ignoreAreas String @default("[]") - tempIgnoreAreas String @default("[]") -} - -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 -} diff --git a/prisma/migrations/20201201211711-test-run--temp-ignore-areas-added/steps.json b/prisma/migrations/20201201211711-test-run--temp-ignore-areas-added/steps.json deleted file mode 100644 index 872604df..00000000 --- a/prisma/migrations/20201201211711-test-run--temp-ignore-areas-added/steps.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "version": "0.3.14-fixed", - "steps": [ - { - "tag": "CreateField", - "model": "TestRun", - "field": "tempIgnoreAreas", - "type": "String", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "TestRun", - "field": "tempIgnoreAreas" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "TestRun", - "field": "tempIgnoreAreas" - }, - "directive": "default" - }, - "argument": "", - "value": "\"[]\"" - } - ] -} \ No newline at end of file diff --git a/prisma/migrations/20210118201534-build--project-id---ci-build-id-constraint/README.md b/prisma/migrations/20210118201534-build--project-id---ci-build-id-constraint/README.md deleted file mode 100644 index aee525c5..00000000 --- a/prisma/migrations/20210118201534-build--project-id---ci-build-id-constraint/README.md +++ /dev/null @@ -1,52 +0,0 @@ -# Migration `20210118201534-build--project-id---ci-build-id-constraint` - -This migration has been generated by Pavel Strunkin at 1/18/2021, 10:15:34 PM. -You can check out the [state of the schema](./schema.prisma) after the migration. - -## Database Steps - -```sql -DROP INDEX "Build.ciBuildId_unique" - -CREATE UNIQUE INDEX "Build.projectId_ciBuildId_unique" ON "Build"("projectId", "ciBuildId") -``` - -## Changes - -```diff -diff --git schema.prisma schema.prisma -migration 20201201211711-test-run--temp-ignore-areas-added..20210118201534-build--project-id---ci-build-id-constraint ---- datamodel.dml -+++ datamodel.dml -@@ -1,17 +1,16 @@ - generator client { -- provider = "prisma-client-js" -- previewFeatures = ["atomicNumberOperations"] -+ provider = "prisma-client-js" - } - datasource db { - provider = "postgresql" -- url = "***" -+ url = "***" - } - model Build { - id String @id @default(uuid()) -- ciBuildId String? @unique -+ ciBuildId String? - number Int? - branchName String? - status String? - testRuns TestRun[] -@@ -21,8 +20,10 @@ - createdAt DateTime @default(now()) - user User? @relation(fields: [userId], references: [id]) - userId String? - isRunning Boolean? -+ -+ @@unique([projectId, ciBuildId]) - } - model Project { - id String @id @default(uuid()) -``` - - diff --git a/prisma/migrations/20210118201534-build--project-id---ci-build-id-constraint/schema.prisma b/prisma/migrations/20210118201534-build--project-id---ci-build-id-constraint/schema.prisma deleted file mode 100644 index 01ef0d55..00000000 --- a/prisma/migrations/20210118201534-build--project-id---ci-build-id-constraint/schema.prisma +++ /dev/null @@ -1,122 +0,0 @@ -generator client { - provider = "prisma-client-js" -} - -datasource db { - provider = "postgresql" - url = "***" -} - -model Build { - id String @id @default(uuid()) - ciBuildId String? - 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? - - @@unique([projectId, ciBuildId]) -} - -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? - comment String? - baseline Baseline? - branchName String @default("master") - baselineBranchName String? - ignoreAreas String @default("[]") - tempIgnoreAreas String @default("[]") -} - -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 -} diff --git a/prisma/migrations/20210118201534-build--project-id---ci-build-id-constraint/steps.json b/prisma/migrations/20210118201534-build--project-id---ci-build-id-constraint/steps.json deleted file mode 100644 index 095b8973..00000000 --- a/prisma/migrations/20210118201534-build--project-id---ci-build-id-constraint/steps.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "version": "0.3.14-fixed", - "steps": [ - { - "tag": "DeleteDirective", - "location": { - "path": { - "tag": "Field", - "model": "Build", - "field": "ciBuildId" - }, - "directive": "unique" - } - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Model", - "model": "Build", - "arguments": [ - { - "name": "", - "value": "[projectId, ciBuildId]" - } - ] - }, - "directive": "unique" - } - } - ] -} \ No newline at end of file diff --git a/prisma/migrations/20210130115922-test-run-auto-approve-status-added/README.md b/prisma/migrations/20210130115922-test-run-auto-approve-status-added/README.md deleted file mode 100644 index a1063681..00000000 --- a/prisma/migrations/20210130115922-test-run-auto-approve-status-added/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# Migration `20210130115922-test-run-auto-approve-status-added` - -This migration has been generated by Pavlo Strunkin at 1/30/2021, 1:59:22 PM. -You can check out the [state of the schema](./schema.prisma) after the migration. - -## Database Steps - -```sql -ALTER TYPE "TestStatus" ADD VALUE 'autoApproved' -``` - -## Changes - -```diff -diff --git schema.prisma schema.prisma -migration 20210118201534-build--project-id---ci-build-id-constraint..20210130115922-test-run-auto-approve-status-added ---- datamodel.dml -+++ datamodel.dml -@@ -3,9 +3,9 @@ - } - datasource db { - provider = "postgresql" -- url = "***" -+ url = "***" - } - model Build { - id String @id @default(uuid()) -@@ -118,5 +118,6 @@ - new - ok - unresolved - approved -+ autoApproved - } -``` - - diff --git a/prisma/migrations/20210130115922-test-run-auto-approve-status-added/schema.prisma b/prisma/migrations/20210130115922-test-run-auto-approve-status-added/schema.prisma deleted file mode 100644 index f34e30cd..00000000 --- a/prisma/migrations/20210130115922-test-run-auto-approve-status-added/schema.prisma +++ /dev/null @@ -1,123 +0,0 @@ -generator client { - provider = "prisma-client-js" -} - -datasource db { - provider = "postgresql" - url = "***" -} - -model Build { - id String @id @default(uuid()) - ciBuildId String? - 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? - - @@unique([projectId, ciBuildId]) -} - -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? - comment String? - baseline Baseline? - branchName String @default("master") - baselineBranchName String? - ignoreAreas String @default("[]") - tempIgnoreAreas String @default("[]") -} - -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 - autoApproved -} diff --git a/prisma/migrations/20210130115922-test-run-auto-approve-status-added/steps.json b/prisma/migrations/20210130115922-test-run-auto-approve-status-added/steps.json deleted file mode 100644 index 3b608c05..00000000 --- a/prisma/migrations/20210130115922-test-run-auto-approve-status-added/steps.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "version": "0.3.14-fixed", - "steps": [ - { - "tag": "UpdateEnum", - "enum": "TestStatus", - "createdValues": [ - "autoApproved" - ] - } - ] -} \ No newline at end of file diff --git a/prisma/migrations/20210228121726-test-run--nullable-test-variation-id/README.md b/prisma/migrations/20210228121726-test-run--nullable-test-variation-id/README.md deleted file mode 100644 index 7e965fda..00000000 --- a/prisma/migrations/20210228121726-test-run--nullable-test-variation-id/README.md +++ /dev/null @@ -1,76 +0,0 @@ -# Migration `20210228121726-test-run--nullable-test-variation-id` - -This migration has been generated by Pavel Strunkin at 2/28/2021, 2:17:26 PM. -You can check out the [state of the schema](./schema.prisma) after the migration. - -## Database Steps - -```sql -ALTER TYPE "TestStatus" ADD VALUE 'autoApproved' -``` - -## Changes - -```diff -diff --git schema.prisma schema.prisma -migration 20210130115922-test-run-auto-approve-status-added..20210228121726-test-run--nullable-test-variation-id ---- datamodel.dml -+++ datamodel.dml -@@ -3,9 +3,9 @@ - } - datasource db { - provider = "postgresql" -- url = "***" -+ url = "***" - } - model Build { - id String @id @default(uuid()) -@@ -38,35 +38,35 @@ - @@unique([name]) - } - model TestRun { -- id String @id @default(uuid()) -+ id String @id @default(uuid()) - imageName String - diffName String? - diffPercent Float? -- diffTollerancePercent Float @default(0) -+ 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()) -+ 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("") -+ name String @default("") - browser String? - device String? - os String? - viewport String? - baselineName String? - comment String? - baseline Baseline? -- branchName String @default("master") -+ branchName String @default("master") - baselineBranchName String? -- ignoreAreas String @default("[]") -- tempIgnoreAreas String @default("[]") -+ ignoreAreas String @default("[]") -+ tempIgnoreAreas String @default("[]") - } - model TestVariation { - id String @id @default(uuid()) -``` - - diff --git a/prisma/migrations/20210228121726-test-run--nullable-test-variation-id/schema.prisma b/prisma/migrations/20210228121726-test-run--nullable-test-variation-id/schema.prisma deleted file mode 100644 index a8ac40c3..00000000 --- a/prisma/migrations/20210228121726-test-run--nullable-test-variation-id/schema.prisma +++ /dev/null @@ -1,123 +0,0 @@ -generator client { - provider = "prisma-client-js" -} - -datasource db { - provider = "postgresql" - url = "***" -} - -model Build { - id String @id @default(uuid()) - ciBuildId String? - 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? - - @@unique([projectId, ciBuildId]) -} - -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? - comment String? - baseline Baseline? - branchName String @default("master") - baselineBranchName String? - ignoreAreas String @default("[]") - tempIgnoreAreas String @default("[]") -} - -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 - autoApproved -} diff --git a/prisma/migrations/20210228121726-test-run--nullable-test-variation-id/steps.json b/prisma/migrations/20210228121726-test-run--nullable-test-variation-id/steps.json deleted file mode 100644 index 50baaef1..00000000 --- a/prisma/migrations/20210228121726-test-run--nullable-test-variation-id/steps.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "version": "0.3.14-fixed", - "steps": [ - { - "tag": "UpdateField", - "model": "TestRun", - "field": "testVariationId", - "arity": "Optional" - }, - { - "tag": "UpdateField", - "model": "TestRun", - "field": "testVariation", - "arity": "Optional" - } - ] -} \ No newline at end of file diff --git a/prisma/migrations/20210405171118-github_243-set-empty-test-variation-tags-instead-of-null/README.md b/prisma/migrations/20210405171118-github_243-set-empty-test-variation-tags-instead-of-null/README.md deleted file mode 100644 index 866b9e46..00000000 --- a/prisma/migrations/20210405171118-github_243-set-empty-test-variation-tags-instead-of-null/README.md +++ /dev/null @@ -1,54 +0,0 @@ -# Migration `20210405171118-github_243-set-empty-test-variation-tags-instead-of-null` - -This migration has been generated by Pavel Strunkin at 4/5/2021, 8:11:18 PM. -You can check out the [state of the schema](./schema.prisma) after the migration. - -## Database Steps - -```sql -ALTER TABLE "TestVariation" ALTER COLUMN "browser" SET NOT NULL, -ALTER COLUMN "browser" SET DEFAULT E'', -ALTER COLUMN "device" SET NOT NULL, -ALTER COLUMN "device" SET DEFAULT E'', -ALTER COLUMN "os" SET NOT NULL, -ALTER COLUMN "os" SET DEFAULT E'', -ALTER COLUMN "viewport" SET NOT NULL, -ALTER COLUMN "viewport" SET DEFAULT E'' -``` - -## Changes - -```diff -diff --git schema.prisma schema.prisma -migration 20210228121726-test-run--nullable-test-variation-id..20210405171118-github_243-set-empty-test-variation-tags-instead-of-null ---- datamodel.dml -+++ datamodel.dml -@@ -3,9 +3,9 @@ - } - datasource db { - provider = "postgresql" -- url = "***" -+ url = "***" - } - model Build { - id String @id @default(uuid()) -@@ -71,12 +71,12 @@ - model TestVariation { - id String @id @default(uuid()) - name String - branchName String @default("master") -- browser String? -- device String? -- os String? -- viewport String? -+ browser String @default("") -+ device String @default("") -+ os String @default("") -+ viewport String @default("") - baselineName String? - ignoreAreas String @default("[]") - projectId String - project Project @relation(fields: [projectId], references: [id]) -``` - - diff --git a/prisma/migrations/20210405171118-github_243-set-empty-test-variation-tags-instead-of-null/schema.prisma b/prisma/migrations/20210405171118-github_243-set-empty-test-variation-tags-instead-of-null/schema.prisma deleted file mode 100644 index 9019c4ab..00000000 --- a/prisma/migrations/20210405171118-github_243-set-empty-test-variation-tags-instead-of-null/schema.prisma +++ /dev/null @@ -1,123 +0,0 @@ -generator client { - provider = "prisma-client-js" -} - -datasource db { - provider = "postgresql" - url = "***" -} - -model Build { - id String @id @default(uuid()) - ciBuildId String? - 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? - - @@unique([projectId, ciBuildId]) -} - -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? - comment String? - baseline Baseline? - branchName String @default("master") - baselineBranchName String? - ignoreAreas String @default("[]") - tempIgnoreAreas String @default("[]") -} - -model TestVariation { - id String @id @default(uuid()) - name String - branchName String @default("master") - browser String @default("") - device String @default("") - os String @default("") - viewport String @default("") - 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 - autoApproved -} diff --git a/prisma/migrations/20210405171118-github_243-set-empty-test-variation-tags-instead-of-null/steps.json b/prisma/migrations/20210405171118-github_243-set-empty-test-variation-tags-instead-of-null/steps.json deleted file mode 100644 index 92b2c8b6..00000000 --- a/prisma/migrations/20210405171118-github_243-set-empty-test-variation-tags-instead-of-null/steps.json +++ /dev/null @@ -1,129 +0,0 @@ -{ - "version": "0.3.14-fixed", - "steps": [ - { - "tag": "UpdateField", - "model": "TestVariation", - "field": "browser", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "TestVariation", - "field": "browser" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "TestVariation", - "field": "browser" - }, - "directive": "default" - }, - "argument": "", - "value": "\"\"" - }, - { - "tag": "UpdateField", - "model": "TestVariation", - "field": "device", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "TestVariation", - "field": "device" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "TestVariation", - "field": "device" - }, - "directive": "default" - }, - "argument": "", - "value": "\"\"" - }, - { - "tag": "UpdateField", - "model": "TestVariation", - "field": "os", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "TestVariation", - "field": "os" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "TestVariation", - "field": "os" - }, - "directive": "default" - }, - "argument": "", - "value": "\"\"" - }, - { - "tag": "UpdateField", - "model": "TestVariation", - "field": "viewport", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "TestVariation", - "field": "viewport" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "TestVariation", - "field": "viewport" - }, - "directive": "default" - }, - "argument": "", - "value": "\"\"" - } - ] -} \ No newline at end of file diff --git a/prisma/migrations/20210425191116-github_215_project_config/README.md b/prisma/migrations/20210425191116-github_215_project_config/README.md deleted file mode 100644 index b8998a82..00000000 --- a/prisma/migrations/20210425191116-github_215_project_config/README.md +++ /dev/null @@ -1,76 +0,0 @@ -# Migration `20210425191116-github_215_project_config` - -This migration has been generated by Pavel Strunkin at 4/25/2021, 10:11:16 PM. -You can check out the [state of the schema](./schema.prisma) after the migration. - -## Database Steps - -```sql -CREATE TYPE "public"."ImageComparison" AS ENUM ('pixelmatch', 'lookSame', 'odiff') - -ALTER TABLE "Project" ADD COLUMN "autoApproveFeature" BOOLEAN NOT NULL DEFAULT false, -ADD COLUMN "diffDimensionsFeature" BOOLEAN NOT NULL DEFAULT false, -ADD COLUMN "ignoreAntialiasing" BOOLEAN NOT NULL DEFAULT true, -ADD COLUMN "threshold" DECIMAL(65,30) NOT NULL DEFAULT 0.1, -ADD COLUMN "imageComparison" "ImageComparison" NOT NULL DEFAULT E'pixelmatch' - -``` - -## Changes - -```diff -diff --git schema.prisma schema.prisma -migration 20210405171118-github_243-set-empty-test-variation-tags-instead-of-null..20210425191116-github_215_project_config ---- datamodel.dml -+++ datamodel.dml -@@ -3,9 +3,9 @@ - } - datasource db { - provider = "postgresql" -- url = "***" -+ url = "***" - } - model Build { - id String @id @default(uuid()) -@@ -25,16 +25,22 @@ - @@unique([projectId, ciBuildId]) - } - 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()) -+ 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()) -+ // config -+ autoApproveFeature Boolean @default(false) -+ diffDimensionsFeature Boolean @default(false) -+ ignoreAntialiasing Boolean @default(true) -+ threshold Float @default(0.1) -+ imageComparison ImageComparison @default(pixelmatch) - @@unique([name]) - } -@@ -120,4 +126,10 @@ - unresolved - approved - autoApproved - } -+ -+enum ImageComparison { -+ pixelmatch -+ lookSame -+ odiff -+} -``` - - diff --git a/prisma/migrations/20210425191116-github_215_project_config/schema.prisma b/prisma/migrations/20210425191116-github_215_project_config/schema.prisma deleted file mode 100644 index 0d1cfc6c..00000000 --- a/prisma/migrations/20210425191116-github_215_project_config/schema.prisma +++ /dev/null @@ -1,135 +0,0 @@ -generator client { - provider = "prisma-client-js" -} - -datasource db { - provider = "postgresql" - url = "***" -} - -model Build { - id String @id @default(uuid()) - ciBuildId String? - 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? - - @@unique([projectId, ciBuildId]) -} - -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()) - // config - autoApproveFeature Boolean @default(false) - diffDimensionsFeature Boolean @default(false) - ignoreAntialiasing Boolean @default(true) - threshold Float @default(0.1) - imageComparison ImageComparison @default(pixelmatch) - - @@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? - comment String? - baseline Baseline? - branchName String @default("master") - baselineBranchName String? - ignoreAreas String @default("[]") - tempIgnoreAreas String @default("[]") -} - -model TestVariation { - id String @id @default(uuid()) - name String - branchName String @default("master") - browser String @default("") - device String @default("") - os String @default("") - viewport String @default("") - 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 - autoApproved -} - -enum ImageComparison { - pixelmatch - lookSame - odiff -} diff --git a/prisma/migrations/20210425191116-github_215_project_config/steps.json b/prisma/migrations/20210425191116-github_215_project_config/steps.json deleted file mode 100644 index f9ba1e36..00000000 --- a/prisma/migrations/20210425191116-github_215_project_config/steps.json +++ /dev/null @@ -1,174 +0,0 @@ -{ - "version": "0.3.14-fixed", - "steps": [ - { - "tag": "CreateEnum", - "enum": "ImageComparison", - "values": [ - "pixelmatch", - "lookSame", - "odiff" - ] - }, - { - "tag": "CreateField", - "model": "Project", - "field": "autoApproveFeature", - "type": "Boolean", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Project", - "field": "autoApproveFeature" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "Project", - "field": "autoApproveFeature" - }, - "directive": "default" - }, - "argument": "", - "value": "false" - }, - { - "tag": "CreateField", - "model": "Project", - "field": "diffDimensionsFeature", - "type": "Boolean", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Project", - "field": "diffDimensionsFeature" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "Project", - "field": "diffDimensionsFeature" - }, - "directive": "default" - }, - "argument": "", - "value": "false" - }, - { - "tag": "CreateField", - "model": "Project", - "field": "ignoreAntialiasing", - "type": "Boolean", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Project", - "field": "ignoreAntialiasing" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "Project", - "field": "ignoreAntialiasing" - }, - "directive": "default" - }, - "argument": "", - "value": "true" - }, - { - "tag": "CreateField", - "model": "Project", - "field": "threshold", - "type": "Float", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Project", - "field": "threshold" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "Project", - "field": "threshold" - }, - "directive": "default" - }, - "argument": "", - "value": "0.1" - }, - { - "tag": "CreateField", - "model": "Project", - "field": "imageComparison", - "type": "ImageComparison", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Project", - "field": "imageComparison" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "Project", - "field": "imageComparison" - }, - "directive": "default" - }, - "argument": "", - "value": "pixelmatch" - } - ] -} \ No newline at end of file diff --git a/prisma/migrations/20210517203552-add-custom-tags/README.md b/prisma/migrations/20210517203552-add-custom-tags/README.md deleted file mode 100644 index 2cfcb133..00000000 --- a/prisma/migrations/20210517203552-add-custom-tags/README.md +++ /dev/null @@ -1,65 +0,0 @@ -# Migration `20210517203552-add-custom-tags` - -This migration has been generated by Surat Das at 5/17/2021, 1:35:52 PM. -You can check out the [state of the schema](./schema.prisma) after the migration. - -## Database Steps - -```sql -DROP INDEX "TestVariation.projectId_name_browser_device_os_viewport_branchN" - -ALTER TABLE "TestRun" ADD COLUMN "customTags" TEXT DEFAULT E'' - -ALTER TABLE "TestVariation" ADD COLUMN "customTags" TEXT NOT NULL DEFAULT E'' - -CREATE UNIQUE INDEX "TestVariation.projectId_name_browser_device_os_viewport_customTags_branchName_unique" ON "TestVariation"("projectId", "name", "browser", "device", "os", "viewport", "customTags", "branchName") -``` - -## Changes - -```diff -diff --git schema.prisma schema.prisma -migration 20210425191116-github_215_project_config..20210517203552-add-custom-tags ---- datamodel.dml -+++ datamodel.dml -@@ -3,9 +3,9 @@ - } - datasource db { - provider = "postgresql" -- url = "***" -+ url = "***" - } - model Build { - id String @id @default(uuid()) -@@ -64,8 +64,9 @@ - browser String? - device String? - os String? - viewport String? -+ customTags String? @default("") - baselineName String? - comment String? - baseline Baseline? - branchName String @default("master") -@@ -81,8 +82,9 @@ - browser String @default("") - device String @default("") - os String @default("") - viewport String @default("") -+ customTags String @default("") - baselineName String? - ignoreAreas String @default("[]") - projectId String - project Project @relation(fields: [projectId], references: [id]) -@@ -91,9 +93,9 @@ - comment String? - updatedAt DateTime @updatedAt - createdAt DateTime @default(now()) -- @@unique([projectId, name, browser, device, os, viewport, branchName]) -+ @@unique([projectId, name, browser, device, os, viewport, customTags, branchName]) - } - model Baseline { - id String @id @default(uuid()) -``` - - diff --git a/prisma/migrations/20210517203552-add-custom-tags/schema.prisma b/prisma/migrations/20210517203552-add-custom-tags/schema.prisma deleted file mode 100644 index a37836bf..00000000 --- a/prisma/migrations/20210517203552-add-custom-tags/schema.prisma +++ /dev/null @@ -1,137 +0,0 @@ -generator client { - provider = "prisma-client-js" -} - -datasource db { - provider = "postgresql" - url = "***" -} - -model Build { - id String @id @default(uuid()) - ciBuildId String? - 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? - - @@unique([projectId, ciBuildId]) -} - -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()) - // config - autoApproveFeature Boolean @default(false) - diffDimensionsFeature Boolean @default(false) - ignoreAntialiasing Boolean @default(true) - threshold Float @default(0.1) - imageComparison ImageComparison @default(pixelmatch) - - @@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? - customTags String? @default("") - baselineName String? - comment String? - baseline Baseline? - branchName String @default("master") - baselineBranchName String? - ignoreAreas String @default("[]") - tempIgnoreAreas String @default("[]") -} - -model TestVariation { - id String @id @default(uuid()) - name String - branchName String @default("master") - browser String @default("") - device String @default("") - os String @default("") - viewport String @default("") - customTags String @default("") - 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, customTags, 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 - autoApproved -} - -enum ImageComparison { - pixelmatch - lookSame - odiff -} diff --git a/prisma/migrations/20210517203552-add-custom-tags/steps.json b/prisma/migrations/20210517203552-add-custom-tags/steps.json deleted file mode 100644 index 82fab038..00000000 --- a/prisma/migrations/20210517203552-add-custom-tags/steps.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "version": "0.3.14-fixed", - "steps": [ - { - "tag": "CreateField", - "model": "TestRun", - "field": "customTags", - "type": "String", - "arity": "Optional" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "TestRun", - "field": "customTags" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "TestRun", - "field": "customTags" - }, - "directive": "default" - }, - "argument": "", - "value": "\"\"" - }, - { - "tag": "CreateField", - "model": "TestVariation", - "field": "customTags", - "type": "String", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "TestVariation", - "field": "customTags" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "TestVariation", - "field": "customTags" - }, - "directive": "default" - }, - "argument": "", - "value": "\"\"" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Model", - "model": "TestVariation", - "arguments": [ - { - "name": "", - "value": "[projectId, name, browser, device, os, viewport, customTags, branchName]" - } - ] - }, - "directive": "unique" - } - }, - { - "tag": "DeleteDirective", - "location": { - "path": { - "tag": "Model", - "model": "TestVariation", - "arguments": [ - { - "name": "", - "value": "[projectId, name, browser, device, os, viewport, branchName]" - } - ] - }, - "directive": "unique" - } - } - ] -} \ No newline at end of file diff --git a/prisma/migrations/20210605124856-image-compare-config-as-json/README.md b/prisma/migrations/20210605124856-image-compare-config-as-json/README.md deleted file mode 100644 index 70b49eff..00000000 --- a/prisma/migrations/20210605124856-image-compare-config-as-json/README.md +++ /dev/null @@ -1,45 +0,0 @@ -# Migration `20210605124856-image-compare-config-as-json` - -This migration has been generated by Pavel Strunkin at 6/5/2021, 3:48:56 PM. -You can check out the [state of the schema](./schema.prisma) after the migration. - -## Database Steps - -```sql -ALTER TABLE "Project" DROP COLUMN "diffDimensionsFeature", -DROP COLUMN "ignoreAntialiasing", -DROP COLUMN "threshold", -ADD COLUMN "imageComparisonConfig" TEXT NOT NULL DEFAULT E'{ "threshold": 0.1, "ignoreAntialiasing": true, "allowDiffDimensions": false }' -``` - -## Changes - -```diff -diff --git schema.prisma schema.prisma -migration 20210517203552-add-custom-tags..20210605124856-image-compare-config-as-json ---- datamodel.dml -+++ datamodel.dml -@@ -3,9 +3,9 @@ - } - datasource db { - provider = "postgresql" -- url = "***" -+ url = "***" - } - model Build { - id String @id @default(uuid()) -@@ -35,12 +35,10 @@ - updatedAt DateTime @updatedAt - createdAt DateTime @default(now()) - // config - autoApproveFeature Boolean @default(false) -- diffDimensionsFeature Boolean @default(false) -- ignoreAntialiasing Boolean @default(true) -- threshold Float @default(0.1) - imageComparison ImageComparison @default(pixelmatch) -+ imageComparisonConfig String @default("{ \"threshold\": 0.1, \"ignoreAntialiasing\": true, \"allowDiffDimensions\": false }") - @@unique([name]) - } -``` - - diff --git a/prisma/migrations/20210605124856-image-compare-config-as-json/schema.prisma b/prisma/migrations/20210605124856-image-compare-config-as-json/schema.prisma deleted file mode 100644 index f1422676..00000000 --- a/prisma/migrations/20210605124856-image-compare-config-as-json/schema.prisma +++ /dev/null @@ -1,135 +0,0 @@ -generator client { - provider = "prisma-client-js" -} - -datasource db { - provider = "postgresql" - url = "***" -} - -model Build { - id String @id @default(uuid()) - ciBuildId String? - 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? - - @@unique([projectId, ciBuildId]) -} - -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()) - // config - autoApproveFeature Boolean @default(false) - imageComparison ImageComparison @default(pixelmatch) - imageComparisonConfig String @default("{ \"threshold\": 0.1, \"ignoreAntialiasing\": true, \"allowDiffDimensions\": false }") - - @@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? - customTags String? @default("") - baselineName String? - comment String? - baseline Baseline? - branchName String @default("master") - baselineBranchName String? - ignoreAreas String @default("[]") - tempIgnoreAreas String @default("[]") -} - -model TestVariation { - id String @id @default(uuid()) - name String - branchName String @default("master") - browser String @default("") - device String @default("") - os String @default("") - viewport String @default("") - customTags String @default("") - 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, customTags, 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 - autoApproved -} - -enum ImageComparison { - pixelmatch - lookSame - odiff -} diff --git a/prisma/migrations/20210605124856-image-compare-config-as-json/steps.json b/prisma/migrations/20210605124856-image-compare-config-as-json/steps.json deleted file mode 100644 index d6b38056..00000000 --- a/prisma/migrations/20210605124856-image-compare-config-as-json/steps.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "version": "0.3.14-fixed", - "steps": [ - { - "tag": "CreateField", - "model": "Project", - "field": "imageComparisonConfig", - "type": "String", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Project", - "field": "imageComparisonConfig" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "Project", - "field": "imageComparisonConfig" - }, - "directive": "default" - }, - "argument": "", - "value": "\"{ \\\"threshold\\\": 0.1, \\\"ignoreAntialiasing\\\": true, \\\"allowDiffDimensions\\\": false }\"" - }, - { - "tag": "DeleteField", - "model": "Project", - "field": "diffDimensionsFeature" - }, - { - "tag": "DeleteField", - "model": "Project", - "field": "ignoreAntialiasing" - }, - { - "tag": "DeleteField", - "model": "Project", - "field": "threshold" - } - ] -} \ No newline at end of file diff --git a/prisma/migrations/20210612140950-limit-build-number/README.md b/prisma/migrations/20210612140950-limit-build-number/README.md deleted file mode 100644 index fc7d16cc..00000000 --- a/prisma/migrations/20210612140950-limit-build-number/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# Migration `20210612140950-limit-build-number` - -This migration has been generated by Pavel Strunkin at 6/12/2021, 5:09:50 PM. -You can check out the [state of the schema](./schema.prisma) after the migration. - -## Database Steps - -```sql -ALTER TABLE "Project" ADD COLUMN "maxBuildAllowed" INTEGER NOT NULL DEFAULT 100 -``` - -## Changes - -```diff -diff --git schema.prisma schema.prisma -migration 20210605124856-image-compare-config-as-json..20210612140950-limit-build-number ---- datamodel.dml -+++ datamodel.dml -@@ -3,9 +3,9 @@ - } - datasource db { - provider = "postgresql" -- url = "***" -+ url = "***" - } - model Build { - id String @id @default(uuid()) -@@ -30,8 +30,9 @@ - name String - mainBranchName String @default("master") - builds Build[] - buildsCounter Int @default(0) -+ maxBuildAllowed Int @default(100) - testVariations TestVariation[] - updatedAt DateTime @updatedAt - createdAt DateTime @default(now()) - // config -``` - - diff --git a/prisma/migrations/20210612140950-limit-build-number/schema.prisma b/prisma/migrations/20210612140950-limit-build-number/schema.prisma deleted file mode 100644 index 617ef110..00000000 --- a/prisma/migrations/20210612140950-limit-build-number/schema.prisma +++ /dev/null @@ -1,136 +0,0 @@ -generator client { - provider = "prisma-client-js" -} - -datasource db { - provider = "postgresql" - url = "***" -} - -model Build { - id String @id @default(uuid()) - ciBuildId String? - 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? - - @@unique([projectId, ciBuildId]) -} - -model Project { - id String @id @default(uuid()) - name String - mainBranchName String @default("master") - builds Build[] - buildsCounter Int @default(0) - maxBuildAllowed Int @default(100) - testVariations TestVariation[] - updatedAt DateTime @updatedAt - createdAt DateTime @default(now()) - // config - autoApproveFeature Boolean @default(false) - imageComparison ImageComparison @default(pixelmatch) - imageComparisonConfig String @default("{ \"threshold\": 0.1, \"ignoreAntialiasing\": true, \"allowDiffDimensions\": false }") - - @@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? - customTags String? @default("") - baselineName String? - comment String? - baseline Baseline? - branchName String @default("master") - baselineBranchName String? - ignoreAreas String @default("[]") - tempIgnoreAreas String @default("[]") -} - -model TestVariation { - id String @id @default(uuid()) - name String - branchName String @default("master") - browser String @default("") - device String @default("") - os String @default("") - viewport String @default("") - customTags String @default("") - 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, customTags, 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 - autoApproved -} - -enum ImageComparison { - pixelmatch - lookSame - odiff -} diff --git a/prisma/migrations/20210612140950-limit-build-number/steps.json b/prisma/migrations/20210612140950-limit-build-number/steps.json deleted file mode 100644 index bcc184ec..00000000 --- a/prisma/migrations/20210612140950-limit-build-number/steps.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "version": "0.3.14-fixed", - "steps": [ - { - "tag": "CreateField", - "model": "Project", - "field": "maxBuildAllowed", - "type": "Int", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Project", - "field": "maxBuildAllowed" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "Project", - "field": "maxBuildAllowed" - }, - "directive": "default" - }, - "argument": "", - "value": "100" - } - ] -} \ No newline at end of file diff --git a/prisma/migrations/20210705154453-baseline-author/README.md b/prisma/migrations/20210705154453-baseline-author/README.md deleted file mode 100644 index 58fb9f38..00000000 --- a/prisma/migrations/20210705154453-baseline-author/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# Migration `20210705154453-baseline-author` - -This migration has been generated by Pavlo Strunkin at 7/5/2021, 6:44:53 PM. -You can check out the [state of the schema](./schema.prisma) after the migration. - -## Database Steps - -```sql -ALTER TABLE "Baseline" ADD COLUMN "userId" TEXT - -ALTER TABLE "Baseline" ADD FOREIGN KEY("userId")REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE -``` - -## Changes - -```diff -diff --git schema.prisma schema.prisma -migration 20210612140950-limit-build-number..20210705154453-baseline-author ---- datamodel.dml -+++ datamodel.dml -@@ -3,9 +3,9 @@ - } - datasource db { - provider = "postgresql" -- url = "***" -+ url = "***" - } - model Build { - id String @id @default(uuid()) -@@ -102,9 +102,11 @@ - testVariationId String - testVariation TestVariation @relation(fields: [testVariationId], references: [id]) - testRunId String? - testRun TestRun? @relation(fields: [testRunId], references: [id]) -- updatedAt DateTime @updatedAt -+ userId String? -+ user User? @relation(fields: [userId], references: [id]) -+ updatedAt DateTime @updatedAt - createdAt DateTime @default(now()) - } - model User { -@@ -115,8 +117,9 @@ - lastName String? - apiKey String @unique - isActive Boolean @default(true) - builds Build[] -+ baselines Baseline[] - updatedAt DateTime @updatedAt - createdAt DateTime @default(now()) - } -``` - - diff --git a/prisma/migrations/20210705154453-baseline-author/schema.prisma b/prisma/migrations/20210705154453-baseline-author/schema.prisma deleted file mode 100644 index e3dbff04..00000000 --- a/prisma/migrations/20210705154453-baseline-author/schema.prisma +++ /dev/null @@ -1,139 +0,0 @@ -generator client { - provider = "prisma-client-js" -} - -datasource db { - provider = "postgresql" - url = "***" -} - -model Build { - id String @id @default(uuid()) - ciBuildId String? - 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? - - @@unique([projectId, ciBuildId]) -} - -model Project { - id String @id @default(uuid()) - name String - mainBranchName String @default("master") - builds Build[] - buildsCounter Int @default(0) - maxBuildAllowed Int @default(100) - testVariations TestVariation[] - updatedAt DateTime @updatedAt - createdAt DateTime @default(now()) - // config - autoApproveFeature Boolean @default(false) - imageComparison ImageComparison @default(pixelmatch) - imageComparisonConfig String @default("{ \"threshold\": 0.1, \"ignoreAntialiasing\": true, \"allowDiffDimensions\": false }") - - @@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? - customTags String? @default("") - baselineName String? - comment String? - baseline Baseline? - branchName String @default("master") - baselineBranchName String? - ignoreAreas String @default("[]") - tempIgnoreAreas String @default("[]") -} - -model TestVariation { - id String @id @default(uuid()) - name String - branchName String @default("master") - browser String @default("") - device String @default("") - os String @default("") - viewport String @default("") - customTags String @default("") - 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, customTags, 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]) - userId String? - user User? @relation(fields: [userId], 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[] - baselines Baseline[] - updatedAt DateTime @updatedAt - createdAt DateTime @default(now()) -} - -enum TestStatus { - failed - new - ok - unresolved - approved - autoApproved -} - -enum ImageComparison { - pixelmatch - lookSame - odiff -} diff --git a/prisma/migrations/20210705154453-baseline-author/steps.json b/prisma/migrations/20210705154453-baseline-author/steps.json deleted file mode 100644 index d38fb48e..00000000 --- a/prisma/migrations/20210705154453-baseline-author/steps.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "version": "0.3.14-fixed", - "steps": [ - { - "tag": "CreateField", - "model": "User", - "field": "baselines", - "type": "Baseline", - "arity": "List" - }, - { - "tag": "CreateField", - "model": "Baseline", - "field": "userId", - "type": "String", - "arity": "Optional" - }, - { - "tag": "CreateField", - "model": "Baseline", - "field": "user", - "type": "User", - "arity": "Optional" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Baseline", - "field": "user" - }, - "directive": "relation" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "Baseline", - "field": "user" - }, - "directive": "relation" - }, - "argument": "fields", - "value": "[userId]" - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "Baseline", - "field": "user" - }, - "directive": "relation" - }, - "argument": "references", - "value": "[id]" - } - ] -} \ No newline at end of file diff --git a/prisma/migrations/20210709115233-gh-275-max-branch-lifetime/README.md b/prisma/migrations/20210709115233-gh-275-max-branch-lifetime/README.md deleted file mode 100644 index 60fbdee7..00000000 --- a/prisma/migrations/20210709115233-gh-275-max-branch-lifetime/README.md +++ /dev/null @@ -1,74 +0,0 @@ -# Migration `20210709115233-gh-275-max-branch-lifetime` - -This migration has been generated by Pavel Strunkin at 7/9/2021, 2:52:33 PM. -You can check out the [state of the schema](./schema.prisma) after the migration. - -## Database Steps - -```sql -ALTER TABLE "Baseline" ADD COLUMN "userId" TEXT - -ALTER TABLE "Project" ADD COLUMN "maxBranchLifetime" INTEGER NOT NULL DEFAULT 30 - -ALTER TABLE "Baseline" ADD FOREIGN KEY("userId")REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE -``` - -## Changes - -```diff -diff --git schema.prisma schema.prisma -migration 20210705154453-baseline-author..20210709115233-gh-275-max-branch-lifetime ---- datamodel.dml -+++ datamodel.dml -@@ -3,9 +3,9 @@ - } - datasource db { - provider = "postgresql" -- url = "***" -+ url = "***" - } - model Build { - id String @id @default(uuid()) -@@ -31,8 +31,9 @@ - mainBranchName String @default("master") - builds Build[] - buildsCounter Int @default(0) - maxBuildAllowed Int @default(100) -+ maxBranchLifetime Int @default(30) - testVariations TestVariation[] - updatedAt DateTime @updatedAt - createdAt DateTime @default(now()) - // config -@@ -104,24 +105,24 @@ - testRunId String? - testRun TestRun? @relation(fields: [testRunId], references: [id]) - userId String? - user User? @relation(fields: [userId], references: [id]) -- updatedAt DateTime @updatedAt -+ updatedAt DateTime @updatedAt - createdAt DateTime @default(now()) - } - model User { -- id String @id @default(uuid()) -- email String @unique -+ id String @id @default(uuid()) -+ email String @unique - password String - firstName String? - lastName String? -- apiKey String @unique -- isActive Boolean @default(true) -+ apiKey String @unique -+ isActive Boolean @default(true) - builds Build[] - baselines Baseline[] -- updatedAt DateTime @updatedAt -- createdAt DateTime @default(now()) -+ updatedAt DateTime @updatedAt -+ createdAt DateTime @default(now()) - } - enum TestStatus { - failed -``` - - diff --git a/prisma/migrations/20210709115233-gh-275-max-branch-lifetime/schema.prisma b/prisma/migrations/20210709115233-gh-275-max-branch-lifetime/schema.prisma deleted file mode 100644 index b19e84ac..00000000 --- a/prisma/migrations/20210709115233-gh-275-max-branch-lifetime/schema.prisma +++ /dev/null @@ -1,140 +0,0 @@ -generator client { - provider = "prisma-client-js" -} - -datasource db { - provider = "postgresql" - url = "***" -} - -model Build { - id String @id @default(uuid()) - ciBuildId String? - 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? - - @@unique([projectId, ciBuildId]) -} - -model Project { - id String @id @default(uuid()) - name String - mainBranchName String @default("master") - builds Build[] - buildsCounter Int @default(0) - maxBuildAllowed Int @default(100) - maxBranchLifetime Int @default(30) - testVariations TestVariation[] - updatedAt DateTime @updatedAt - createdAt DateTime @default(now()) - // config - autoApproveFeature Boolean @default(false) - imageComparison ImageComparison @default(pixelmatch) - imageComparisonConfig String @default("{ \"threshold\": 0.1, \"ignoreAntialiasing\": true, \"allowDiffDimensions\": false }") - - @@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? - customTags String? @default("") - baselineName String? - comment String? - baseline Baseline? - branchName String @default("master") - baselineBranchName String? - ignoreAreas String @default("[]") - tempIgnoreAreas String @default("[]") -} - -model TestVariation { - id String @id @default(uuid()) - name String - branchName String @default("master") - browser String @default("") - device String @default("") - os String @default("") - viewport String @default("") - customTags String @default("") - 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, customTags, 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]) - userId String? - user User? @relation(fields: [userId], 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[] - baselines Baseline[] - updatedAt DateTime @updatedAt - createdAt DateTime @default(now()) -} - -enum TestStatus { - failed - new - ok - unresolved - approved - autoApproved -} - -enum ImageComparison { - pixelmatch - lookSame - odiff -} diff --git a/prisma/migrations/20210709115233-gh-275-max-branch-lifetime/steps.json b/prisma/migrations/20210709115233-gh-275-max-branch-lifetime/steps.json deleted file mode 100644 index 15027e91..00000000 --- a/prisma/migrations/20210709115233-gh-275-max-branch-lifetime/steps.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "version": "0.3.14-fixed", - "steps": [ - { - "tag": "CreateField", - "model": "Project", - "field": "maxBranchLifetime", - "type": "Int", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Project", - "field": "maxBranchLifetime" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "Project", - "field": "maxBranchLifetime" - }, - "directive": "default" - }, - "argument": "", - "value": "30" - } - ] -} \ No newline at end of file diff --git a/prisma/migrations/20210709133029-275-project-to-testrun-relation/README.md b/prisma/migrations/20210709133029-275-project-to-testrun-relation/README.md deleted file mode 100644 index 6d56845b..00000000 --- a/prisma/migrations/20210709133029-275-project-to-testrun-relation/README.md +++ /dev/null @@ -1,51 +0,0 @@ -# Migration `20210709133029-275-project-to-testrun-relation` - -This migration has been generated by Pavel Strunkin at 7/9/2021, 4:30:29 PM. -You can check out the [state of the schema](./schema.prisma) after the migration. - -## Database Steps - -```sql -ALTER TABLE "TestRun" ADD COLUMN "projectId" TEXT - -ALTER TABLE "TestRun" ADD FOREIGN KEY("projectId")REFERENCES "Project"("id") ON DELETE SET NULL ON UPDATE CASCADE -``` - -## Changes - -```diff -diff --git schema.prisma schema.prisma -migration 20210709115233-gh-275-max-branch-lifetime..20210709133029-275-project-to-testrun-relation ---- datamodel.dml -+++ datamodel.dml -@@ -3,9 +3,9 @@ - } - datasource db { - provider = "postgresql" -- url = "***" -+ url = "***" - } - model Build { - id String @id @default(uuid()) -@@ -40,8 +40,9 @@ - autoApproveFeature Boolean @default(false) - imageComparison ImageComparison @default(pixelmatch) - imageComparisonConfig String @default("{ \"threshold\": 0.1, \"ignoreAntialiasing\": true, \"allowDiffDimensions\": false }") -+ TestRun TestRun[] - @@unique([name]) - } - model TestRun { -@@ -55,8 +56,10 @@ - buildId String - build Build @relation(fields: [buildId], references: [id]) - testVariationId String? - testVariation TestVariation? @relation(fields: [testVariationId], references: [id]) -+ projectId String? -+ project Project? @relation(fields: [projectId], references: [id]) - merge Boolean @default(false) - updatedAt DateTime @updatedAt - createdAt DateTime @default(now()) - // Test variation data -``` - - diff --git a/prisma/migrations/20210709133029-275-project-to-testrun-relation/schema.prisma b/prisma/migrations/20210709133029-275-project-to-testrun-relation/schema.prisma deleted file mode 100644 index a91c3cbf..00000000 --- a/prisma/migrations/20210709133029-275-project-to-testrun-relation/schema.prisma +++ /dev/null @@ -1,143 +0,0 @@ -generator client { - provider = "prisma-client-js" -} - -datasource db { - provider = "postgresql" - url = "***" -} - -model Build { - id String @id @default(uuid()) - ciBuildId String? - 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? - - @@unique([projectId, ciBuildId]) -} - -model Project { - id String @id @default(uuid()) - name String - mainBranchName String @default("master") - builds Build[] - buildsCounter Int @default(0) - maxBuildAllowed Int @default(100) - maxBranchLifetime Int @default(30) - testVariations TestVariation[] - updatedAt DateTime @updatedAt - createdAt DateTime @default(now()) - // config - autoApproveFeature Boolean @default(false) - imageComparison ImageComparison @default(pixelmatch) - imageComparisonConfig String @default("{ \"threshold\": 0.1, \"ignoreAntialiasing\": true, \"allowDiffDimensions\": false }") - - TestRun TestRun[] - @@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]) - projectId String? - project Project? @relation(fields: [projectId], 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? - customTags String? @default("") - baselineName String? - comment String? - baseline Baseline? - branchName String @default("master") - baselineBranchName String? - ignoreAreas String @default("[]") - tempIgnoreAreas String @default("[]") -} - -model TestVariation { - id String @id @default(uuid()) - name String - branchName String @default("master") - browser String @default("") - device String @default("") - os String @default("") - viewport String @default("") - customTags String @default("") - 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, customTags, 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]) - userId String? - user User? @relation(fields: [userId], 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[] - baselines Baseline[] - updatedAt DateTime @updatedAt - createdAt DateTime @default(now()) -} - -enum TestStatus { - failed - new - ok - unresolved - approved - autoApproved -} - -enum ImageComparison { - pixelmatch - lookSame - odiff -} diff --git a/prisma/migrations/20210709133029-275-project-to-testrun-relation/steps.json b/prisma/migrations/20210709133029-275-project-to-testrun-relation/steps.json deleted file mode 100644 index 177b6a06..00000000 --- a/prisma/migrations/20210709133029-275-project-to-testrun-relation/steps.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "version": "0.3.14-fixed", - "steps": [ - { - "tag": "CreateField", - "model": "Project", - "field": "TestRun", - "type": "TestRun", - "arity": "List" - }, - { - "tag": "CreateField", - "model": "TestRun", - "field": "projectId", - "type": "String", - "arity": "Optional" - }, - { - "tag": "CreateField", - "model": "TestRun", - "field": "project", - "type": "Project", - "arity": "Optional" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "TestRun", - "field": "project" - }, - "directive": "relation" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "TestRun", - "field": "project" - }, - "directive": "relation" - }, - "argument": "fields", - "value": "[projectId]" - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "TestRun", - "field": "project" - }, - "directive": "relation" - }, - "argument": "references", - "value": "[id]" - } - ] -} \ No newline at end of file diff --git a/prisma/migrations/20210724121852-roles/README.md b/prisma/migrations/20210724121852-roles/README.md deleted file mode 100644 index e6f90be8..00000000 --- a/prisma/migrations/20210724121852-roles/README.md +++ /dev/null @@ -1,52 +0,0 @@ -# Migration `20210724121852-roles` - -This migration has been generated by Pavlo Strunkin at 7/24/2021, 3:18:52 PM. -You can check out the [state of the schema](./schema.prisma) after the migration. - -## Database Steps - -```sql -CREATE TYPE "public"."Role" AS ENUM ('admin', 'editor', 'guest') - -ALTER TABLE "User" ADD COLUMN "role" "Role" NOT NULL DEFAULT E'guest' -``` - -## Changes - -```diff -diff --git schema.prisma schema.prisma -migration 20210709133029-275-project-to-testrun-relation..20210724121852-roles ---- datamodel.dml -+++ datamodel.dml -@@ -3,9 +3,9 @@ - } - datasource db { - provider = "postgresql" -- url = "***" -+ url = "***" - } - model Build { - id String @id @default(uuid()) -@@ -122,8 +122,9 @@ - apiKey String @unique - isActive Boolean @default(true) - builds Build[] - baselines Baseline[] -+ role Role @default(guest) - updatedAt DateTime @updatedAt - createdAt DateTime @default(now()) - } -@@ -140,4 +141,10 @@ - pixelmatch - lookSame - odiff - } -+ -+enum Role { -+ admin -+ editor -+ guest -+} -``` - - diff --git a/prisma/migrations/20210724121852-roles/schema.prisma b/prisma/migrations/20210724121852-roles/schema.prisma deleted file mode 100644 index 1e96e1e6..00000000 --- a/prisma/migrations/20210724121852-roles/schema.prisma +++ /dev/null @@ -1,150 +0,0 @@ -generator client { - provider = "prisma-client-js" -} - -datasource db { - provider = "postgresql" - url = "***" -} - -model Build { - id String @id @default(uuid()) - ciBuildId String? - 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? - - @@unique([projectId, ciBuildId]) -} - -model Project { - id String @id @default(uuid()) - name String - mainBranchName String @default("master") - builds Build[] - buildsCounter Int @default(0) - maxBuildAllowed Int @default(100) - maxBranchLifetime Int @default(30) - testVariations TestVariation[] - updatedAt DateTime @updatedAt - createdAt DateTime @default(now()) - // config - autoApproveFeature Boolean @default(false) - imageComparison ImageComparison @default(pixelmatch) - imageComparisonConfig String @default("{ \"threshold\": 0.1, \"ignoreAntialiasing\": true, \"allowDiffDimensions\": false }") - - TestRun TestRun[] - @@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]) - projectId String? - project Project? @relation(fields: [projectId], 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? - customTags String? @default("") - baselineName String? - comment String? - baseline Baseline? - branchName String @default("master") - baselineBranchName String? - ignoreAreas String @default("[]") - tempIgnoreAreas String @default("[]") -} - -model TestVariation { - id String @id @default(uuid()) - name String - branchName String @default("master") - browser String @default("") - device String @default("") - os String @default("") - viewport String @default("") - customTags String @default("") - 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, customTags, 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]) - userId String? - user User? @relation(fields: [userId], 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[] - baselines Baseline[] - role Role @default(guest) - updatedAt DateTime @updatedAt - createdAt DateTime @default(now()) -} - -enum TestStatus { - failed - new - ok - unresolved - approved - autoApproved -} - -enum ImageComparison { - pixelmatch - lookSame - odiff -} - -enum Role { - admin - editor - guest -} diff --git a/prisma/migrations/20210724121852-roles/steps.json b/prisma/migrations/20210724121852-roles/steps.json deleted file mode 100644 index b8fa6233..00000000 --- a/prisma/migrations/20210724121852-roles/steps.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "version": "0.3.14-fixed", - "steps": [ - { - "tag": "CreateEnum", - "enum": "Role", - "values": [ - "admin", - "editor", - "guest" - ] - }, - { - "tag": "CreateField", - "model": "User", - "field": "role", - "type": "Role", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "User", - "field": "role" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "User", - "field": "role" - }, - "directive": "default" - }, - "argument": "", - "value": "guest" - } - ] -} \ No newline at end of file diff --git a/prisma/migrations/20230730154101_init/migration.sql b/prisma/migrations/20230730154101_init/migration.sql new file mode 100644 index 00000000..e8d31a30 --- /dev/null +++ b/prisma/migrations/20230730154101_init/migration.sql @@ -0,0 +1,166 @@ +-- CreateEnum +CREATE TYPE "TestStatus" AS ENUM ('failed', 'new', 'ok', 'unresolved', 'approved', 'autoApproved'); + +-- CreateEnum +CREATE TYPE "ImageComparison" AS ENUM ('pixelmatch', 'lookSame', 'odiff'); + +-- CreateEnum +CREATE TYPE "Role" AS ENUM ('admin', 'editor', 'guest'); + +-- CreateTable +CREATE TABLE "Build" ( + "id" TEXT NOT NULL, + "ciBuildId" TEXT, + "number" INTEGER, + "branchName" TEXT, + "status" TEXT, + "projectId" TEXT NOT NULL, + "updatedAt" TIMESTAMP(3) NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "userId" TEXT, + "isRunning" BOOLEAN, + + CONSTRAINT "Build_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Project" ( + "id" TEXT NOT NULL, + "name" TEXT NOT NULL, + "mainBranchName" TEXT NOT NULL DEFAULT 'master', + "buildsCounter" INTEGER NOT NULL DEFAULT 0, + "maxBuildAllowed" INTEGER NOT NULL DEFAULT 100, + "maxBranchLifetime" INTEGER NOT NULL DEFAULT 30, + "updatedAt" TIMESTAMP(3) NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "autoApproveFeature" BOOLEAN NOT NULL DEFAULT true, + "imageComparison" "ImageComparison" NOT NULL DEFAULT 'pixelmatch', + "imageComparisonConfig" TEXT NOT NULL DEFAULT '{ "threshold": 0.1, "ignoreAntialiasing": true, "allowDiffDimensions": false }', + + CONSTRAINT "Project_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "TestRun" ( + "id" TEXT NOT NULL, + "imageName" TEXT NOT NULL, + "diffName" TEXT, + "diffPercent" DOUBLE PRECISION, + "diffTollerancePercent" DOUBLE PRECISION NOT NULL DEFAULT 0, + "pixelMisMatchCount" INTEGER, + "status" "TestStatus" NOT NULL, + "buildId" TEXT NOT NULL, + "testVariationId" TEXT, + "projectId" TEXT, + "merge" BOOLEAN NOT NULL DEFAULT false, + "updatedAt" TIMESTAMP(3) NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "name" TEXT NOT NULL DEFAULT '', + "browser" TEXT, + "device" TEXT, + "os" TEXT, + "viewport" TEXT, + "customTags" TEXT DEFAULT '', + "baselineName" TEXT, + "comment" TEXT, + "branchName" TEXT NOT NULL DEFAULT 'master', + "baselineBranchName" TEXT, + "ignoreAreas" TEXT NOT NULL DEFAULT '[]', + "tempIgnoreAreas" TEXT NOT NULL DEFAULT '[]', + + CONSTRAINT "TestRun_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "TestVariation" ( + "id" TEXT NOT NULL, + "name" TEXT NOT NULL, + "branchName" TEXT NOT NULL DEFAULT 'master', + "browser" TEXT NOT NULL DEFAULT '', + "device" TEXT NOT NULL DEFAULT '', + "os" TEXT NOT NULL DEFAULT '', + "viewport" TEXT NOT NULL DEFAULT '', + "customTags" TEXT NOT NULL DEFAULT '', + "baselineName" TEXT, + "ignoreAreas" TEXT NOT NULL DEFAULT '[]', + "projectId" TEXT NOT NULL, + "comment" TEXT, + "updatedAt" TIMESTAMP(3) NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "TestVariation_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Baseline" ( + "id" TEXT NOT NULL, + "baselineName" TEXT NOT NULL, + "testVariationId" TEXT NOT NULL, + "testRunId" TEXT, + "userId" TEXT, + "updatedAt" TIMESTAMP(3) NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "Baseline_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "User" ( + "id" TEXT NOT NULL, + "email" TEXT NOT NULL, + "password" TEXT NOT NULL, + "firstName" TEXT, + "lastName" TEXT, + "apiKey" TEXT NOT NULL, + "isActive" BOOLEAN NOT NULL DEFAULT true, + "role" "Role" NOT NULL DEFAULT 'guest', + "updatedAt" TIMESTAMP(3) NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "User_pkey" PRIMARY KEY ("id") +); + +-- CreateIndex +CREATE UNIQUE INDEX "Build_projectId_ciBuildId_key" ON "Build"("projectId", "ciBuildId"); + +-- CreateIndex +CREATE UNIQUE INDEX "Project_name_key" ON "Project"("name"); + +-- CreateIndex +CREATE UNIQUE INDEX "TestVariation_projectId_name_browser_device_os_viewport_cus_key" ON "TestVariation"("projectId", "name", "browser", "device", "os", "viewport", "customTags", "branchName"); + +-- CreateIndex +CREATE UNIQUE INDEX "Baseline_testRunId_key" ON "Baseline"("testRunId"); + +-- CreateIndex +CREATE UNIQUE INDEX "User_email_key" ON "User"("email"); + +-- CreateIndex +CREATE UNIQUE INDEX "User_apiKey_key" ON "User"("apiKey"); + +-- AddForeignKey +ALTER TABLE "Build" ADD CONSTRAINT "Build_projectId_fkey" FOREIGN KEY ("projectId") REFERENCES "Project"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Build" ADD CONSTRAINT "Build_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "TestRun" ADD CONSTRAINT "TestRun_buildId_fkey" FOREIGN KEY ("buildId") REFERENCES "Build"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "TestRun" ADD CONSTRAINT "TestRun_projectId_fkey" FOREIGN KEY ("projectId") REFERENCES "Project"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "TestRun" ADD CONSTRAINT "TestRun_testVariationId_fkey" FOREIGN KEY ("testVariationId") REFERENCES "TestVariation"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "TestVariation" ADD CONSTRAINT "TestVariation_projectId_fkey" FOREIGN KEY ("projectId") REFERENCES "Project"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Baseline" ADD CONSTRAINT "Baseline_testRunId_fkey" FOREIGN KEY ("testRunId") REFERENCES "TestRun"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Baseline" ADD CONSTRAINT "Baseline_testVariationId_fkey" FOREIGN KEY ("testVariationId") REFERENCES "TestVariation"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Baseline" ADD CONSTRAINT "Baseline_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE; diff --git a/prisma/migrations/migrate.lock b/prisma/migrations/migrate.lock deleted file mode 100644 index 98d9703d..00000000 --- a/prisma/migrations/migrate.lock +++ /dev/null @@ -1,26 +0,0 @@ -# Prisma Migrate lockfile v1 - -20200503001556-init -20200524162125-baseline-history -20200526195312-approved-test-status-added -20200627134248-comment-added -20200707182652-project-name-unique-constraint -20200715232608-branch-strategy -20200728221159-zero-diff-tolerance -20200812213545-build-run-status -20200909223305-test-variation-project-id-added-into-unique-constraint -20201007145002-builds-counter -20201115155739-ci-build-id-added -20201201211711-test-run--temp-ignore-areas-added -20210118201534-build--project-id---ci-build-id-constraint -20210130115922-test-run-auto-approve-status-added -20210228121726-test-run--nullable-test-variation-id -20210405171118-github_243-set-empty-test-variation-tags-instead-of-null -20210425191116-github_215_project_config -20210517203552-add-custom-tags -20210605124856-image-compare-config-as-json -20210612140950-limit-build-number -20210705154453-baseline-author -20210709115233-gh-275-max-branch-lifetime -20210709133029-275-project-to-testrun-relation -20210724121852-roles \ No newline at end of file diff --git a/prisma/migrations/migration_lock.toml b/prisma/migrations/migration_lock.toml new file mode 100644 index 00000000..fbffa92c --- /dev/null +++ b/prisma/migrations/migration_lock.toml @@ -0,0 +1,3 @@ +# Please do not edit this file manually +# It should be added in your version-control system (i.e. Git) +provider = "postgresql" \ No newline at end of file diff --git a/prisma/package-lock.json b/prisma/package-lock.json index abdafb2f..b9c046a7 100644 --- a/prisma/package-lock.json +++ b/prisma/package-lock.json @@ -1,43 +1,345 @@ { "name": "vrt-migration", "version": "1.2.0", - "lockfileVersion": 1, + "lockfileVersion": 2, "requires": true, + "packages": { + "": { + "name": "vrt-migration", + "version": "1.2.0", + "license": "Apache-2.0", + "dependencies": { + "@prisma/client": "^5.0.0", + "bcryptjs": "^2.4.3" + }, + "devDependencies": { + "@types/bcryptjs": "^2.4.2", + "prisma": "^5.0.0", + "ts-node": "^10.7.0", + "typescript": "^4.9.2" + } + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@prisma/client": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@prisma/client/-/client-5.0.0.tgz", + "integrity": "sha512-XlO5ELNAQ7rV4cXIDJUNBEgdLwX3pjtt9Q/RHqDpGf43szpNJx2hJnggfFs7TKNx0cOFsl6KJCSfqr5duEU/bQ==", + "hasInstallScript": true, + "dependencies": { + "@prisma/engines-version": "4.17.0-26.6b0aef69b7cdfc787f822ecd7cdc76d5f1991584" + }, + "engines": { + "node": ">=16.13" + }, + "peerDependencies": { + "prisma": "*" + }, + "peerDependenciesMeta": { + "prisma": { + "optional": true + } + } + }, + "node_modules/@prisma/engines": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-5.0.0.tgz", + "integrity": "sha512-kyT/8fd0OpWmhAU5YnY7eP31brW1q1YrTGoblWrhQJDiN/1K+Z8S1kylcmtjqx5wsUGcP1HBWutayA/jtyt+sg==", + "devOptional": true, + "hasInstallScript": true + }, + "node_modules/@prisma/engines-version": { + "version": "4.17.0-26.6b0aef69b7cdfc787f822ecd7cdc76d5f1991584", + "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-4.17.0-26.6b0aef69b7cdfc787f822ecd7cdc76d5f1991584.tgz", + "integrity": "sha512-HHiUF6NixsldsP3JROq07TYBLEjXFKr6PdH8H4gK/XAoTmIplOJBCgrIUMrsRAnEuGyRoRLXKXWUb943+PFoKQ==" + }, + "node_modules/@tsconfig/node10": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", + "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", + "dev": true + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "dev": true + }, + "node_modules/@types/bcryptjs": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/@types/bcryptjs/-/bcryptjs-2.4.2.tgz", + "integrity": "sha512-LiMQ6EOPob/4yUL66SZzu6Yh77cbzJFYll+ZfaPiPPFswtIlA/Fs1MzdKYA7JApHU49zQTbJGX3PDmCpIdDBRQ==", + "dev": true + }, + "node_modules/@types/node": { + "version": "20.4.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.4.2.tgz", + "integrity": "sha512-Dd0BYtWgnWJKwO1jkmTrzofjK2QXXcai0dmtzvIBhcA+RsG5h8R3xlyta0kGOZRNfL9GuRtb1knmPEhQrePCEw==", + "dev": true, + "peer": true + }, + "node_modules/acorn": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, + "node_modules/bcryptjs": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz", + "integrity": "sha1-mrVie5PmBiH/fNrF2pczAn3x0Ms=" + }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true + }, + "node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, + "node_modules/prisma": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/prisma/-/prisma-5.0.0.tgz", + "integrity": "sha512-KYWk83Fhi1FH59jSpavAYTt2eoMVW9YKgu8ci0kuUnt6Dup5Qy47pcB4/TLmiPAbhGrxxSz7gsSnJcCmkyPANA==", + "devOptional": true, + "hasInstallScript": true, + "dependencies": { + "@prisma/engines": "5.0.0" + }, + "bin": { + "prisma": "build/index.js" + }, + "engines": { + "node": ">=16.13" + } + }, + "node_modules/ts-node": { + "version": "10.9.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", + "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", + "dev": true, + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/typescript": { + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true + }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "engines": { + "node": ">=6" + } + } + }, "dependencies": { - "@prisma/bar": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/@prisma/bar/-/bar-0.0.1.tgz", - "integrity": "sha512-FVLhwVkbfhXlBhroWfIXMLi+3Jh9IEzYp+9z+MUUiw3ZsbcoAil7CN9/QIjHc4/TcCRyRfuSmT7qCnn4O+TjJw==", + "@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "requires": { + "@jridgewell/trace-mapping": "0.3.9" + } + }, + "@jridgewell/resolve-uri": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true + }, + "@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", "dev": true }, - "@prisma/cli": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/@prisma/cli/-/cli-2.12.1.tgz", - "integrity": "sha512-obkwK95dEeifCdVehG0rS0BlPQGLsOtc9U1MgbrjNX3MnhXQdwROnvymfPB3DBlNyoLoHGklPgi9UlwBokNXcQ==", + "@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", "dev": true, "requires": { - "@prisma/bar": "^0.0.1", - "@prisma/engines": "2.12.0-18.cf0680a1bfe8d5e743dc659cc7f08009f9587d58" + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" } }, "@prisma/client": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/@prisma/client/-/client-2.12.1.tgz", - "integrity": "sha512-HP4/E9sRdxw/FB7XP4EeRa5ri8Lp1U/L7G4VAA95aM8C+8ARioQHMNDpEjC83NrOrOr4EcaZV5pXDDQL1H+F0g==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@prisma/client/-/client-5.0.0.tgz", + "integrity": "sha512-XlO5ELNAQ7rV4cXIDJUNBEgdLwX3pjtt9Q/RHqDpGf43szpNJx2hJnggfFs7TKNx0cOFsl6KJCSfqr5duEU/bQ==", "requires": { - "@prisma/engines-version": "2.12.0-18.cf0680a1bfe8d5e743dc659cc7f08009f9587d58" + "@prisma/engines-version": "4.17.0-26.6b0aef69b7cdfc787f822ecd7cdc76d5f1991584" } }, "@prisma/engines": { - "version": "2.12.0-18.cf0680a1bfe8d5e743dc659cc7f08009f9587d58", - "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-2.12.0-18.cf0680a1bfe8d5e743dc659cc7f08009f9587d58.tgz", - "integrity": "sha512-F6RmUZ5JpPWxmGvVDji8c4gepHIGkvYbtuFi0IoDDJVaCVo8yS656stciKFyswI6/BLWXa0X47/MIMbz6nzw7g==", - "dev": true + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-5.0.0.tgz", + "integrity": "sha512-kyT/8fd0OpWmhAU5YnY7eP31brW1q1YrTGoblWrhQJDiN/1K+Z8S1kylcmtjqx5wsUGcP1HBWutayA/jtyt+sg==", + "devOptional": true }, "@prisma/engines-version": { - "version": "2.12.0-18.cf0680a1bfe8d5e743dc659cc7f08009f9587d58", - "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-2.12.0-18.cf0680a1bfe8d5e743dc659cc7f08009f9587d58.tgz", - "integrity": "sha512-IHb/Jag1Wmoq5tLZhOHP5zqLHEXqQEfrHb6l0drIBSvh2AF7yWQ3yyuD0ZEb1Nq37SvbBgop5wrWMOU8YWFTGQ==" + "version": "4.17.0-26.6b0aef69b7cdfc787f822ecd7cdc76d5f1991584", + "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-4.17.0-26.6b0aef69b7cdfc787f822ecd7cdc76d5f1991584.tgz", + "integrity": "sha512-HHiUF6NixsldsP3JROq07TYBLEjXFKr6PdH8H4gK/XAoTmIplOJBCgrIUMrsRAnEuGyRoRLXKXWUb943+PFoKQ==" + }, + "@tsconfig/node10": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", + "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", + "dev": true + }, + "@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true + }, + "@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true + }, + "@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "dev": true }, "@types/bcryptjs": { "version": "2.4.2", @@ -45,6 +347,25 @@ "integrity": "sha512-LiMQ6EOPob/4yUL66SZzu6Yh77cbzJFYll+ZfaPiPPFswtIlA/Fs1MzdKYA7JApHU49zQTbJGX3PDmCpIdDBRQ==", "dev": true }, + "@types/node": { + "version": "20.4.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.4.2.tgz", + "integrity": "sha512-Dd0BYtWgnWJKwO1jkmTrzofjK2QXXcai0dmtzvIBhcA+RsG5h8R3xlyta0kGOZRNfL9GuRtb1knmPEhQrePCEw==", + "dev": true, + "peer": true + }, + "acorn": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "dev": true + }, + "acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "dev": true + }, "arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", @@ -56,89 +377,65 @@ "resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz", "integrity": "sha1-mrVie5PmBiH/fNrF2pczAn3x0Ms=" }, - "buffer-from": { + "create-require": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", "dev": true }, - "colors": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", - "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==" - }, - "commander": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz", - "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==" - }, "diff": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true }, - "encode32": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/encode32/-/encode32-1.1.0.tgz", - "integrity": "sha1-DFS0X7MUrVUC48Iwy5Ws3F5c0d0=" - }, "make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", "dev": true }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "source-map-support": { - "version": "0.5.19", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", - "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", - "dev": true, + "prisma": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/prisma/-/prisma-5.0.0.tgz", + "integrity": "sha512-KYWk83Fhi1FH59jSpavAYTt2eoMVW9YKgu8ci0kuUnt6Dup5Qy47pcB4/TLmiPAbhGrxxSz7gsSnJcCmkyPANA==", + "devOptional": true, "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" + "@prisma/engines": "5.0.0" } }, "ts-node": { - "version": "8.10.2", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.10.2.tgz", - "integrity": "sha512-ISJJGgkIpDdBhWVu3jufsWpK3Rzo7bdiIXJjQc0ynKxVOVcg2oIrf2H2cejminGrptVc6q6/uynAHNCuWGbpVA==", + "version": "10.9.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", + "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", "dev": true, "requires": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", "arg": "^4.1.0", + "create-require": "^1.1.0", "diff": "^4.0.1", "make-error": "^1.1.1", - "source-map-support": "^0.5.17", + "v8-compile-cache-lib": "^3.0.1", "yn": "3.1.1" } }, "typescript": { - "version": "3.9.7", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz", - "integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "dev": true }, - "uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" - }, - "uuid-apikey": { - "version": "1.4.6", - "resolved": "https://registry.npmjs.org/uuid-apikey/-/uuid-apikey-1.4.6.tgz", - "integrity": "sha512-ulcRze13Ic9nKGWsUgGgc7XJFMKM8nR7Oxc/tEUQeFbGyJzk4M2uO/BhVG1zSgERN/n1eTS15GB6hi/rSC+YSA==", - "requires": { - "colors": "^1.4.0", - "commander": "^3.0.2", - "encode32": "^1.1.0", - "uuid": "^3.3.3" - } + "v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true }, "yn": { "version": "3.1.1", diff --git a/prisma/package.json b/prisma/package.json index bf404ecf..6381d3a7 100644 --- a/prisma/package.json +++ b/prisma/package.json @@ -4,16 +4,16 @@ "description": "", "author": "", "private": true, - "license": "UNLICENSED", + "license": "Apache-2.0", "scripts": {}, "dependencies": { - "@prisma/client": "2.12.1", + "@prisma/client": "^5.0.0", "bcryptjs": "^2.4.3" }, "devDependencies": { - "@prisma/cli": "2.12.1", "@types/bcryptjs": "^2.4.2", - "ts-node": "^8.10.2", - "typescript": "^3.9.7" + "prisma": "^5.0.0", + "ts-node": "^10.7.0", + "typescript": "^4.9.2" } } diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 72da9e09..2397b49d 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -13,36 +13,33 @@ model Build { 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? + project Project @relation(fields: [projectId], references: [id]) + user User? @relation(fields: [userId], references: [id]) + testRuns TestRun[] @@unique([projectId, ciBuildId]) } model Project { id String @id @default(uuid()) - name String + name String @unique mainBranchName String @default("master") - builds Build[] buildsCounter Int @default(0) maxBuildAllowed Int @default(100) maxBranchLifetime Int @default(30) - testVariations TestVariation[] updatedAt DateTime @updatedAt createdAt DateTime @default(now()) - // config - autoApproveFeature Boolean @default(false) + autoApproveFeature Boolean @default(true) imageComparison ImageComparison @default(pixelmatch) imageComparisonConfig String @default("{ \"threshold\": 0.1, \"ignoreAntialiasing\": true, \"allowDiffDimensions\": false }") - - TestRun TestRun[] - @@unique([name]) + builds Build[] + TestRun TestRun[] + testVariations TestVariation[] } model TestRun { @@ -54,15 +51,11 @@ model TestRun { pixelMisMatchCount Int? status TestStatus buildId String - build Build @relation(fields: [buildId], references: [id]) testVariationId String? - testVariation TestVariation? @relation(fields: [testVariationId], references: [id]) projectId String? - project Project? @relation(fields: [projectId], references: [id]) merge Boolean @default(false) updatedAt DateTime @updatedAt createdAt DateTime @default(now()) - // Test variation data name String @default("") browser String? device String? @@ -71,11 +64,14 @@ model TestRun { customTags String? @default("") baselineName String? comment String? - baseline Baseline? branchName String @default("master") baselineBranchName String? ignoreAreas String @default("[]") tempIgnoreAreas String @default("[]") + baseline Baseline? + build Build @relation(fields: [buildId], references: [id]) + project Project? @relation(fields: [projectId], references: [id]) + testVariation TestVariation? @relation(fields: [testVariationId], references: [id]) } model TestVariation { @@ -90,12 +86,12 @@ model TestVariation { 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()) + baselines Baseline[] + testRuns TestRun[] + project Project @relation(fields: [projectId], references: [id]) @@unique([projectId, name, browser, device, os, viewport, customTags, branchName]) } @@ -104,13 +100,13 @@ 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]) + testRunId String? @unique userId String? - user User? @relation(fields: [userId], references: [id]) updatedAt DateTime @updatedAt createdAt DateTime @default(now()) + testRun TestRun? @relation(fields: [testRunId], references: [id]) + testVariation TestVariation @relation(fields: [testVariationId], references: [id]) + user User? @relation(fields: [userId], references: [id]) } model User { @@ -121,11 +117,11 @@ model User { lastName String? apiKey String @unique isActive Boolean @default(true) - builds Build[] - baselines Baseline[] role Role @default(guest) updatedAt DateTime @updatedAt createdAt DateTime @default(now()) + baselines Baseline[] + builds Build[] } enum TestStatus { diff --git a/prisma/seed.ts b/prisma/seed.ts index ea9fe999..a7ad0565 100644 --- a/prisma/seed.ts +++ b/prisma/seed.ts @@ -1,8 +1,12 @@ +/** + * @see https://www.prisma.io/docs/guides/migrate/seed-database + */ import { PrismaClient, Role } from '@prisma/client'; import { genSalt, hash } from 'bcryptjs'; const prisma = new PrismaClient({ - // log: ['query'], + // 'info' | 'query' | 'warn' | 'error' + log: ['query'], }); async function seed() { @@ -17,8 +21,15 @@ seed() .finally(async () => await prisma.$disconnect()); async function createDefaultUser() { - const userList = await prisma.user.findMany(); - console.log(userList); + let userList = []; + try { + userList = await prisma.user.findMany(); + console.log(userList); + } + catch (error) { + // Expected to see that "user" table does not exist + console.log(error.message); + } const defaultEmail = 'visual-regression-tracker@example.com'; const defaultPassword = '123456'; @@ -54,8 +65,16 @@ async function createDefaultUser() { } async function createDefaultProject() { - const projectList = await prisma.project.findMany(); - console.log(projectList); + let projectList = []; + try { + projectList = await prisma.project.findMany(); + console.log(projectList); + } + catch (error) { + // Expected to see that "project" table does not exist + console.log(error.message); + } + if (projectList.length === 0) { await prisma.project .create({ diff --git a/src/builds/builds.controller.spec.ts b/src/builds/builds.controller.spec.ts index d61ce2e9..f1314507 100644 --- a/src/builds/builds.controller.spec.ts +++ b/src/builds/builds.controller.spec.ts @@ -6,7 +6,7 @@ import { ApiGuard } from '../auth/guards/api.guard'; import { JwtAuthGuard } from '../auth/guards/auth.guard'; import { ProjectsService } from '../projects/projects.service'; import { TEST_BUILD, TEST_PROJECT } from '../_data_'; -import { Build } from '.prisma/client'; +import { Build } from '@prisma/client'; import { BuildDto } from './dto/build.dto'; import { CreateBuildDto } from './dto/build-create.dto'; import { EventsGateway } from '../shared/events/events.gateway'; diff --git a/src/compare/compare.service.ts b/src/compare/compare.service.ts index 62aa5a1c..0af46c7b 100644 --- a/src/compare/compare.service.ts +++ b/src/compare/compare.service.ts @@ -1,4 +1,4 @@ -import { ImageComparison, Project } from '.prisma/client'; +import { ImageComparison, Project } from '@prisma/client'; import { Injectable } from '@nestjs/common'; import { PixelmatchService } from './libs/pixelmatch/pixelmatch.service'; import { ImageComparator } from './libs/image-comparator.interface'; diff --git a/src/health/health.controller.ts b/src/health/health.controller.ts index 891bddeb..a7709c45 100644 --- a/src/health/health.controller.ts +++ b/src/health/health.controller.ts @@ -13,7 +13,7 @@ export class HealthController { @HealthCheck() check() { return this.health.check([ - () => this.prismaService.$queryRaw('SELECT 1'), + () => this.prismaService.$queryRaw`SELECT 1`, ]); } } diff --git a/src/test-variations/test-variations.service.ts b/src/test-variations/test-variations.service.ts index a2e88ef5..7b08d3a4 100644 --- a/src/test-variations/test-variations.service.ts +++ b/src/test-variations/test-variations.service.ts @@ -1,6 +1,6 @@ import { Injectable, Inject, forwardRef, Logger } from '@nestjs/common'; import { PrismaService } from '../prisma/prisma.service'; -import { TestVariation, Baseline, Prisma, Build } from '@prisma/client'; +import { TestVariation, Baseline, Build } from '@prisma/client'; import { StaticService } from '../shared/static/static.service'; import { BuildsService } from '../builds/builds.service'; import { TestRunsService } from '../test-runs/test-runs.service'; @@ -42,7 +42,7 @@ export class TestVariationsService { } async findUnique( - data: Prisma.ProjectIdNameBrowserDeviceOsViewportCustomTagsBranchNameCompoundUniqueInput + data: BaselineDataDto & { projectId: string } ): Promise { return this.prismaService.testVariation.findUnique({ where: { diff --git a/test/builds.e2e-spec.ts b/test/builds.e2e-spec.ts index e7437007..532e3131 100644 --- a/test/builds.e2e-spec.ts +++ b/test/builds.e2e-spec.ts @@ -11,8 +11,7 @@ import { ProjectsService } from '../src/projects/projects.service'; import { TestRunsService } from '../src/test-runs/test-runs.service'; import { BuildsController } from '../src/builds/builds.controller'; import { TEST_PROJECT } from '../src/_data_'; - -jest.useFakeTimers('legacy'); +import uuidAPIKey from 'uuid-apikey'; describe('Builds (e2e)', () => { let app: INestApplication; @@ -43,7 +42,7 @@ describe('Builds (e2e)', () => { user = await haveUserLogged(usersService); project = await projecstService.create({ ...TEST_PROJECT, - name: 'Builds E2E test', + name: `Builds E2E test${uuidAPIKey.create().uuid}`, }); }); @@ -53,7 +52,6 @@ describe('Builds (e2e)', () => { }); afterAll(async () => { - jest.runOnlyPendingTimers(); await app.close(); }); diff --git a/test/test-runs.e2e-spec.ts b/test/test-runs.e2e-spec.ts index 08533776..7c899d0a 100644 --- a/test/test-runs.e2e-spec.ts +++ b/test/test-runs.e2e-spec.ts @@ -10,8 +10,7 @@ import { Project, TestStatus } from '@prisma/client'; import { BuildsService } from '../src/builds/builds.service'; import { TestVariationsService } from '../src/test-variations/test-variations.service'; import { TEST_PROJECT } from '../src/_data_'; - -jest.useFakeTimers('legacy'); +import uuidAPIKey from 'uuid-apikey'; describe('TestRuns (e2e)', () => { let app: INestApplication; @@ -46,7 +45,7 @@ describe('TestRuns (e2e)', () => { user = await haveUserLogged(usersService); project = await projecstService.create({ ...TEST_PROJECT, - name: 'TestRun E2E test', + name: `TestRun E2E test${uuidAPIKey.create().uuid}`, }); }); @@ -56,7 +55,6 @@ describe('TestRuns (e2e)', () => { }); afterAll(async () => { - jest.runOnlyPendingTimers(); await app.close(); }); diff --git a/test/test-variations.e2e-spec.ts b/test/test-variations.e2e-spec.ts index 3019ee76..4bc1cef1 100644 --- a/test/test-variations.e2e-spec.ts +++ b/test/test-variations.e2e-spec.ts @@ -10,8 +10,7 @@ import { Project } from '@prisma/client'; import { BuildsService } from '../src/builds/builds.service'; import { TestVariationsService } from '../src/test-variations/test-variations.service'; import { TEST_PROJECT } from '../src/_data_'; - -jest.useFakeTimers('legacy'); +import uuidAPIKey from 'uuid-apikey'; describe('TestVariations (e2e)', () => { let app: INestApplication; @@ -42,7 +41,7 @@ describe('TestVariations (e2e)', () => { user = await haveUserLogged(usersService); project = await projecstService.create({ ...TEST_PROJECT, - name: 'TestVariations E2E test', + name: `TestVariations E2E test${uuidAPIKey.create().uuid}`, }); }); @@ -52,7 +51,6 @@ describe('TestVariations (e2e)', () => { }); afterAll(async () => { - jest.runOnlyPendingTimers(); await app.close(); });