Use prisma db push instead of migrate deploy on startup
All checks were successful
Build & Push / Build Server (push) Successful in 1m35s
Build & Push / Build Client (push) Successful in 40s

Eliminates the need to generate and commit migration files locally
before first deploy. Schema is synced directly from schema.prisma
on container start.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-30 19:59:55 -04:00
parent 3dce53f1dc
commit 429a530fc8
2 changed files with 2 additions and 15 deletions

View File

@@ -48,20 +48,7 @@ PORT=3080
Point NPM at `http://<host-ip>:3080` for the proxy host. Point NPM at `http://<host-ip>:3080` for the proxy host.
### 3. Create the initial database migration ### 3. Deploy
Run this **once** on your local dev machine before first deploy, then commit the result:
```bash
cd server
npm install
# point at your local postgres or use DATABASE_URL from .env
npm run db:migrate # creates prisma/migrations/
```
Commit the generated `server/prisma/migrations/` folder — `prisma migrate deploy` in the container will apply it on startup.
### 4. Deploy
```bash ```bash
docker compose pull docker compose pull

View File

@@ -5,7 +5,7 @@
"dev": "tsx watch src/index.ts", "dev": "tsx watch src/index.ts",
"build": "tsc", "build": "tsc",
"start": "node dist/index.js", "start": "node dist/index.js",
"start:prod": "prisma migrate deploy && node dist/index.js", "start:prod": "prisma db push && node dist/index.js",
"db:migrate": "prisma migrate dev", "db:migrate": "prisma migrate dev",
"db:push": "prisma db push", "db:push": "prisma db push",
"db:generate": "prisma generate", "db:generate": "prisma generate",