From 31486e4eed424ba86d71c4226b300a9b9056922c Mon Sep 17 00:00:00 2001 From: willwearing Date: Sun, 12 Apr 2026 14:15:54 -0600 Subject: [PATCH] fix: run prisma migrations on Railway startup instead of GitHub Actions GitHub Actions can't reach Supabase direct DB connection (firewalled). Move `prisma migrate deploy` into start:prod so it runs on Railway where the DB is already reachable. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/ci-deploy.yml | 16 ---------------- backend/package.json | 2 +- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/.github/workflows/ci-deploy.yml b/.github/workflows/ci-deploy.yml index 6e3272a..82081bd 100644 --- a/.github/workflows/ci-deploy.yml +++ b/.github/workflows/ci-deploy.yml @@ -188,22 +188,6 @@ jobs: steps: - uses: actions/checkout@v5 - - uses: oven-sh/setup-bun@v2 - with: - bun-version: "1.3.6" - - - name: Install dependencies - run: bun install - - - name: Generate Prisma client - run: cd backend && bun x prisma generate - - - name: Run production migrations - run: cd backend && bun x prisma migrate deploy - env: - DATABASE_URL: ${{ secrets.DATABASE_URL }} - DIRECT_URL: ${{ secrets.DIRECT_URL }} - - name: Install Railway CLI run: npm install -g @railway/cli diff --git a/backend/package.json b/backend/package.json index 95236a6..8fe162c 100644 --- a/backend/package.json +++ b/backend/package.json @@ -6,7 +6,7 @@ "build": "prisma generate && nest build", "dev": "bun x nest build && bun x nest start --watch", "start": "nest start", - "start:prod": "TS_NODE_PROJECT=tsconfig.runtime.json node -r tsconfig-paths/register dist/main.js", + "start:prod": "prisma migrate deploy && TS_NODE_PROJECT=tsconfig.runtime.json node -r tsconfig-paths/register dist/main.js", "test": "jest", "test:watch": "jest --watch", "lint": "eslint --config eslint.config.mjs \"{src,prisma}/**/*.ts\" --fix"