[BUG] Production database schema not updating on deploy - scripts/start keeps getting overwritten
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
I'm using Vibecode to build an app with a backend (Hono, Prisma, SQLite). I renamed database tables from Customer to Property and added new tables (PropertyImage, UserProperty).
The development database works correctly with the new schema. However, the production database still has the old schema and won't update no matter what I try.
The core issue: Every time I deploy, the backend/scripts/start file gets overwritten by a template version (I see commits like "chore: upgrade backend scripts from template"). This removes any custom logic I add to delete/reset the database.
What I've tried:
•Adding database reset logic to scripts/start - gets overwritten on deploy
•Using postinstall hook in package.json to run a reset script
•Adding reset logic to src/db.ts and src/index.ts
•Creating various TypeScript scripts to delete the database
None of these work because either the start script is overwritten, or the code runs AFTER prisma db push has already pushed to the old database.
What I need:
•A way to delete the production database file (prisma/dev.db) so it can be recreated with the correct schema, OR
•A way to run custom code BEFORE prisma db push that won't get overwritten
Project ID: 019c6290-9bca-737a-95f3-cd5557c13056
This has cost significant time and money to debug. Any help would be appreciated.
What Should Happen?
The production database should be updated to match the development version (schema + seed data)
Error Messages/Logs
Steps to Reproduce
Deploy update via vibecode isn't updating the production database
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
the version vibecodeapp is using
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗