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

fix(generator): adapt types generation to fix enum values #1359

Merged
merged 1 commit into from
Sep 12, 2024
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
2 changes: 1 addition & 1 deletion generator/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (t Type) Value() string {
return v
}

return gocase.ToUpper(strcase.ToUpperCamel(str))
return gocase.ToUpper(str)
}

// GoCase transforms strings into Go-style lowercase casing. It is like GoCase but used for private fields.
Expand Down
20 changes: 14 additions & 6 deletions test/features/enums/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,21 @@ generator db {
package = "enums"
}

enum ServerOS {
Unknown
Linux
Windows
Mac
}

model User {
id String @id @default(cuid()) @map("_id")
role Role
roleOpt Role?
stuff1 Stuff?
stuff2 Stuff?
stuff3 Stuff?
id String @id @default(cuid()) @map("_id")
role Role
roleOpt Role?
stuff1 Stuff?
stuff2 Stuff?
stuff3 Stuff?
serverOS ServerOS?
}

enum Role {
Expand Down
Loading