diff --git a/CLAUDE.md b/CLAUDE.md index 559c6c4..0db0a3e 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -520,13 +520,19 @@ The 2026-06-09 file-by-file audit traced most bugs to a handful of patterns. The 2. `npm run build` 3. Commit and tag (`git tag -a vX.Y.Z`) 4. Push to Gitea (`git push origin master && git push origin vX.Y.Z`) -5. Create tarball: `tar -czf app-ts-X.Y.Z.tar.gz dist dist-client prisma package.json package-lock.json scripts` +5. Create tarball: `tar -czf app-ts-X.Y.Z.tar.gz dist dist-client prisma prisma.config.ts package.json package-lock.json scripts` + (⚠️ `prisma.config.ts` is REQUIRED — Prisma 7 keeps the datasource URL there; + without it, `prisma generate`/`migrate deploy` on prod have no datasource) 6. Deploy via SSH to production server (`boha_admin@192.168.50.100`): - Path: `/var/www/app-ts` - - Remove old files: `rm -rf dist dist-client prisma scripts package.json package-lock.json` + - Remove old files: `rm -rf dist dist-client prisma prisma.config.ts scripts package.json package-lock.json` - Copy tarball to server: `scp app-ts-X.Y.Z.tar.gz boha_admin@192.168.50.100:/tmp/` - Extract tarball: `tar -xzf /tmp/app-ts-X.Y.Z.tar.gz` - Install dependencies: `npm install --omit=dev` + - Regenerate the Prisma client: `npx prisma generate` — **MANDATORY**. + `npm install` skips regeneration when dependencies didn't change, leaving a + stale client that still selects dropped/renamed columns → P2022 500s in + prod (bit the v2.4.0 supplier release). - Apply Prisma migrations: `npx prisma migrate deploy` - Restart: `pm2 restart app-ts --update-env`