Background
In `packages/jobs/src/consts.ts` at line 18-19:
```ts
// TODO: Change this to 'backgroundJob' in the next major release
export const DEFAULT_MODEL_NAME = 'BackgroundJob'
```
Currently `DEFAULT_MODEL_NAME` is `'BackgroundJob'` (PascalCase — the Prisma schema model name). The `PrismaAdapter` then calls `camelCase()` internally to derive the actual db accessor (`db.backgroundJob`). This is confusing because the user-facing `model` option and the internal default use a different casing convention than the actual accessor.
Related TODOs in `packages/jobs/src/adapters/PrismaAdapter/PrismaAdapter.ts`:
- Line 179: `// TODO: Remove type casting of `options.model` in the next major release`
- Line 185: `// TODO: Remove the camelCase call in the next major release. It's only here to keep the code backwards compatible`
What needs to be done
In the next major release:
-
`packages/jobs/src/consts.ts` — Change the default to camelCase:
```ts
export const DEFAULT_MODEL_NAME = 'backgroundJob'
```
-
`packages/jobs/src/adapters/PrismaAdapter/PrismaAdapter.ts` — Remove the internal `camelCase()` conversion and backwards-compat type cast. Users should now pass the camelCase model name directly (matching the Prisma client accessor). Update the JSDoc comment on the `model` option accordingly.
-
`packages/jobs/src/adapters/PrismaAdapter/tests/PrismaAdapter.test.ts` — Update the test that asserts `adapter.model === DEFAULT_MODEL_NAME`.
-
`packages/cli/src/commands/setup/jobs/jobsHandler.js` — The schema template still uses `model BackgroundJob` (PascalCase) — this stays correct for the Prisma schema, but the docs/handler should clarify that users pass `'backgroundJob'` (camelCase) to the adapter.
Why
Using PascalCase as the default for the adapter `model` option is inconsistent with how Prisma client exposes models (`db.backgroundJob`). Switching to camelCase as the canonical input makes the API more intuitive and removes the implicit `camelCase()` conversion that can mask typos in custom model names.
Migration note
This is a breaking change — users who rely on the default and don't set `model` explicitly will see no change in behavior. Users who pass `model: 'BackgroundJob'` explicitly will need to change to `model: 'backgroundJob'`. Add a migration guide entry for this.
Background
In `packages/jobs/src/consts.ts` at line 18-19:
```ts
// TODO: Change this to 'backgroundJob' in the next major release
export const DEFAULT_MODEL_NAME = 'BackgroundJob'
```
Currently `DEFAULT_MODEL_NAME` is `'BackgroundJob'` (PascalCase — the Prisma schema model name). The `PrismaAdapter` then calls `camelCase()` internally to derive the actual db accessor (`db.backgroundJob`). This is confusing because the user-facing `model` option and the internal default use a different casing convention than the actual accessor.
Related TODOs in `packages/jobs/src/adapters/PrismaAdapter/PrismaAdapter.ts`:
What needs to be done
In the next major release:
`packages/jobs/src/consts.ts` — Change the default to camelCase:
```ts
export const DEFAULT_MODEL_NAME = 'backgroundJob'
```
`packages/jobs/src/adapters/PrismaAdapter/PrismaAdapter.ts` — Remove the internal `camelCase()` conversion and backwards-compat type cast. Users should now pass the camelCase model name directly (matching the Prisma client accessor). Update the JSDoc comment on the `model` option accordingly.
`packages/jobs/src/adapters/PrismaAdapter/tests/PrismaAdapter.test.ts` — Update the test that asserts `adapter.model === DEFAULT_MODEL_NAME`.
`packages/cli/src/commands/setup/jobs/jobsHandler.js` — The schema template still uses `model BackgroundJob` (PascalCase) — this stays correct for the Prisma schema, but the docs/handler should clarify that users pass `'backgroundJob'` (camelCase) to the adapter.
Why
Using PascalCase as the default for the adapter `model` option is inconsistent with how Prisma client exposes models (`db.backgroundJob`). Switching to camelCase as the canonical input makes the API more intuitive and removes the implicit `camelCase()` conversion that can mask typos in custom model names.
Migration note
This is a breaking change — users who rely on the default and don't set `model` explicitly will see no change in behavior. Users who pass `model: 'BackgroundJob'` explicitly will need to change to `model: 'backgroundJob'`. Add a migration guide entry for this.