Skip to content

Commit 3516796

Browse files
willwearingclaude
andauthored
fix: run prisma migrations on Railway startup instead of GitHub Actions (#121)
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) <noreply@anthropic.com>
1 parent 737b529 commit 3516796

2 files changed

Lines changed: 1 addition & 17 deletions

File tree

.github/workflows/ci-deploy.yml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -188,22 +188,6 @@ jobs:
188188
steps:
189189
- uses: actions/checkout@v5
190190

191-
- uses: oven-sh/setup-bun@v2
192-
with:
193-
bun-version: "1.3.6"
194-
195-
- name: Install dependencies
196-
run: bun install
197-
198-
- name: Generate Prisma client
199-
run: cd backend && bun x prisma generate
200-
201-
- name: Run production migrations
202-
run: cd backend && bun x prisma migrate deploy
203-
env:
204-
DATABASE_URL: ${{ secrets.DATABASE_URL }}
205-
DIRECT_URL: ${{ secrets.DIRECT_URL }}
206-
207191
- name: Install Railway CLI
208192
run: npm install -g @railway/cli
209193

backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"build": "prisma generate && nest build",
77
"dev": "bun x nest build && bun x nest start --watch",
88
"start": "nest start",
9-
"start:prod": "TS_NODE_PROJECT=tsconfig.runtime.json node -r tsconfig-paths/register dist/main.js",
9+
"start:prod": "prisma migrate deploy && TS_NODE_PROJECT=tsconfig.runtime.json node -r tsconfig-paths/register dist/main.js",
1010
"test": "jest",
1111
"test:watch": "jest --watch",
1212
"lint": "eslint --config eslint.config.mjs \"{src,prisma}/**/*.ts\" --fix"

0 commit comments

Comments
 (0)