Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,12 @@ describe('getGenerators', () => {
expect(stripVTControlCharacters(e.message)).toMatchInlineSnapshot(`
"
You don't have any models defined in your schema.prisma, so nothing will be generated.
You can define a model like this:

Prisma Client is typically generated from models defined in your schema. If you plan to use raw SQL queries only (e.g. $queryRaw), remove the --require-models flag to generate the client without models:

$ prisma generate

Otherwise, you can define a model like this:

model User {
id Int @id @default(autoincrement())
Expand Down Expand Up @@ -694,7 +699,12 @@ describe('getGenerators', () => {
expect(stripVTControlCharacters(e.message)).toMatchInlineSnapshot(`
"
You don't have any models defined in your schema.prisma, so nothing will be generated.
You can define a model like this:

Prisma Client is typically generated from models defined in your schema. If you plan to use raw queries only, remove the --require-models flag to generate the client without models:

$ prisma generate

Otherwise, you can define a model like this:

model User {
id String @id @default(auto()) @map("_id") @db.ObjectId
Expand Down
16 changes: 13 additions & 3 deletions packages/internals/src/utils/missingGeneratorMessage.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { blue, bold } from 'kleur/colors'
import { blue, bold, dim } from 'kleur/colors'

import { highlightDatamodel } from '../highlight/highlight'
import { link } from './link'
Expand All @@ -22,7 +22,12 @@ ${link('https://pris.ly/d/prisma-schema')}
export const missingModelMessage = `\nYou don't have any ${bold('models')} defined in your ${bold(
'schema.prisma',
)}, so nothing will be generated.
You can define a model like this:

Prisma Client is typically generated from models defined in your schema. If you plan to use raw SQL queries only (e.g. ${bold('$queryRaw')}), remove the ${bold('--require-models')} flag to generate the client without models:

${dim('$')} prisma generate

Otherwise, you can define a model like this:

${bold(
highlightDatamodel(`model User {
Expand All @@ -39,7 +44,12 @@ ${link('https://pris.ly/d/prisma-schema')}
export const missingModelMessageMongoDB = `\nYou don't have any ${bold('models')} defined in your ${bold(
'schema.prisma',
)}, so nothing will be generated.
You can define a model like this:

Prisma Client is typically generated from models defined in your schema. If you plan to use raw queries only, remove the ${bold('--require-models')} flag to generate the client without models:

${dim('$')} prisma generate

Otherwise, you can define a model like this:

${bold(
highlightDatamodel(`model User {
Expand Down
Loading