From 5d682d8bdf95ac9f88be0fde84df5f47e0803cf0 Mon Sep 17 00:00:00 2001 From: tsa96 Date: Fri, 27 Sep 2024 17:50:06 +0100 Subject: [PATCH] ci(db): apply migrations to E2E database with `prisma migrate deploy` Trying to make CI fail if migrations aren't committed --- docker-compose.test.yml | 4 ++-- libs/db/project.json | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docker-compose.test.yml b/docker-compose.test.yml index 8d07db6a6..47ea63cf7 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -68,8 +68,8 @@ services: - "3000:3000" command: > sh -c " - npm install - npx nx run db:push && + npm install && + npx nx run db:deploy && npx nx run backend-e2e:e2e " frontend-e2e: diff --git a/libs/db/project.json b/libs/db/project.json index 1027a5350..5404719a9 100644 --- a/libs/db/project.json +++ b/libs/db/project.json @@ -32,6 +32,13 @@ "cwd": "libs/db/src" } }, + "deploy": { + "executor": "nx:run-commands", + "options": { + "command": "prisma migrate deploy", + "cwd": "libs/db/src" + } + }, "create-migration": { "executor": "nx:run-commands", "options": {