Skip to Content

Database changes

The schema is in packages/database/prisma/schema.prisma.

  1. Change the schema. Don't map field or table names to different names in the database.

  2. Create a migration:

    cd packages/database
    bun run db:migrate
  3. Commit the new folder in prisma/migrations with 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:

ScriptWhat it does
bun run db:generateRegenerates the Prisma client.
bun run db:studioOpens Prisma Studio.
bun run db:migrate:resetResets your development database.