From 32397e4075454e0d6629d30fa5adb52cc622eac8 Mon Sep 17 00:00:00 2001 From: dcs-soni <52232900+dcs-soni@users.noreply.github.com> Date: Sun, 9 Nov 2025 16:15:57 +0530 Subject: [PATCH] fix: use compiled migrations in production --- apps/backend/package.json | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/backend/package.json b/apps/backend/package.json index 62bc38f..80aa17d 100644 --- a/apps/backend/package.json +++ b/apps/backend/package.json @@ -13,9 +13,12 @@ "test:unit": "echo 'Vitest setup pending'", "test:e2e": "echo 'E2E tests setup pending'", "migration:new": "set NODE_OPTIONS=--import tsx/esm && knex migrate:make --knexfile src/db/knexfile.ts", - "migration:latest": "set NODE_OPTIONS=--import tsx/esm && knex migrate:latest --knexfile src/db/knexfile.ts", - "migration:rollback": "set NODE_OPTIONS=--import tsx/esm && knex migrate:rollback --knexfile src/db/knexfile.ts", - "migration:status": "set NODE_OPTIONS=--import tsx/esm && knex migrate:status --knexfile src/db/knexfile.ts", + "migration:latest": "NODE_ENV=${NODE_ENV:-production} knex migrate:latest --knexfile dist/db/knexfile.js", + "migration:rollback": "NODE_ENV=${NODE_ENV:-production} knex migrate:rollback --knexfile dist/db/knexfile.js", + "migration:status": "NODE_ENV=${NODE_ENV:-production} knex migrate:status --knexfile dist/db/knexfile.js", + "migration:latest:dev": "set NODE_OPTIONS=--import tsx/esm && knex migrate:latest --knexfile src/db/knexfile.ts", + "migration:rollback:dev": "set NODE_OPTIONS=--import tsx/esm && knex migrate:rollback --knexfile src/db/knexfile.ts", + "migration:status:dev": "set NODE_OPTIONS=--import tsx/esm && knex migrate:status --knexfile src/db/knexfile.ts", "generate:schema": "echo 'Schema generation setup pending'", "docs:open": "echo 'API Documentation available at http://localhost:3001/docs'", "db:seed": "knex seed:run",