Database changes
The schema is in packages/database/prisma/schema.prisma.
-
Change the schema. Don't map field or table names to different names in the database.
-
Create a migration:
cd packages/database bun run db:migrate -
Commit the new folder in
prisma/migrationswith your change.
The backend applies migrations when it starts, so every migration must work with the previous release while a deployment rolls out. A pull request with a migration needs a minor server version bump. See Versions and releases.
Other scripts in packages/database:
| Script | What it does |
|---|---|
bun run db:generate | Regenerates the Prisma client. |
bun run db:studio | Opens Prisma Studio. |
bun run db:migrate:reset | Resets your development database. |