Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression in enum default value handling in 4.7.0 #16546

Closed
pimeys opened this issue Nov 30, 2022 · 0 comments · Fixed by prisma/prisma-engines#3456
Closed

Regression in enum default value handling in 4.7.0 #16546

pimeys opened this issue Nov 30, 2022 · 0 comments · Fixed by prisma/prisma-engines#3456
Assignees
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/regression A reported bug in functionality that used to work before. team/schema Issue for team Schema. tech/engines/introspection engine Issue in the Introspection Engine topic: default topic: enum "type"/block `enum`
Milestone

Comments

@pimeys
Copy link
Contributor

pimeys commented Nov 30, 2022

Bug description

In a case where we cannot decipher any name for the enum variant, in 4.7.0 a default value using this variant is rendered wrong.

In version 4.6.0 we did:

model A {
  id  Int @id
  val B @default(dbgenerated("0"))
}

enum B {
  // 0 @map("0")
}

And in version 4.7.0 we do:

model A {
  id  Int @id
  val B @default()
}

enum B {
  // 0 @map("0")
}

Both data models are invalid, but the old version had less things to fix.

git bisect shows the PR in culprit: prisma/prisma-engines#3381

@pimeys pimeys added kind/bug A reported bug. tech/engines/introspection engine Issue in the Introspection Engine team/schema Issue for team Schema. topic: default topic: enum "type"/block `enum` kind/regression A reported bug in functionality that used to work before. labels Nov 30, 2022
@pimeys pimeys added this to the 4.8.0 milestone Nov 30, 2022
@pimeys pimeys self-assigned this Nov 30, 2022
@janpio janpio added bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. and removed kind/bug A reported bug. labels Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/regression A reported bug in functionality that used to work before. team/schema Issue for team Schema. tech/engines/introspection engine Issue in the Introspection Engine topic: default topic: enum "type"/block `enum`
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants