DB migrate
The database is remote; DATABASE_URL points at the SSH tunnel's local port (5433). All
commands are bun --cwd=apps/api run ….
- Confirm the tunnel is up (
bunx prisma migrate statusfromapps/api). If it isn't, ask the user to runbun run db:tunnelin a separate terminal - don't start it yourself. - Edit the schema - split by domain under
apps/api/prisma/schema/*.prisma. db:migrate- creates the migration SQL only (--create-only), never applies.- Read the generated SQL and confirm it matches intent. Prisma turns renames into drop + add -
hand-edit to
ALTERwhen data must survive. db:migrate:apply, thendb:generate.
Never run db:reset without explicit user confirmation - it wipes the remote database.