From b38ad8f1a95107eb60a4348f5d43b4ed55d09566 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 | 2 +- libs/db/project.json | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docker-compose.test.yml b/docker-compose.test.yml index 8d07db6a6..e24a5ed13 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -69,7 +69,7 @@ services: command: > sh -c " npm install - npx nx run db:push && + 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": {