Skip to content

Commit

Permalink
fix(introspection): display Prisma 1 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Jolg42 committed Jun 2, 2020
1 parent 5f1037f commit 39fdca4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/packages/introspection/src/commands/Introspect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ Then you can run ${chalk.green('prisma introspect')} again.
message += warning.affected
.map((it) => `- Enum "${it.enm}", value: "${it.value}"`)
.join('\n')
} else if (warning.code === 5) {
message += warning.affected
.map((it) => `- Model "${it.model}", field: "${it.field}"`)
.join('\n')
}

message += `\n`
Expand Down
7 changes: 7 additions & 0 deletions src/packages/sdk/src/IntrospectionEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export type IntrospectionWarnings =
| IntrospectionWarningsEmptyFieldName
| IntrospectionWarningsUnsupportedType
| IntrospectionWarningsInvalidEnumName
| IntrospectionWarningsPrisma1

interface IntrospectionWarningsMissingUnique {
code: 1
Expand All @@ -71,6 +72,12 @@ interface IntrospectionWarningsInvalidEnumName {
affected: { enm: string; value: string }[]
}

interface IntrospectionWarningsPrisma1 {
code: 5
message: string
affected: { model: string; field: string }[]
}

export type IntrospectionSchemaVersion =
| 'Prisma2'
| 'Prisma1'
Expand Down

0 comments on commit 39fdca4

Please sign in to comment.