paljs / prisma-tools

Prisma tools to help you generate CRUD system for GraphQL servers
https://paljs.com
MIT License
680 stars 55 forks source link

Schema CamelCase not handling @default("{}") correctly #256

Closed ajhollowayvrm closed 2 years ago

ajhollowayvrm commented 2 years ago

schema.prisma before

model access_overrides {
  id        BigInt @id @default(autoincrement())
  overrides Json?  @default("{}")

  @@index([id], map: "access_overrides_index")
}

schema.prisma after pal schema camel-case

model AccessOverrides {
  id        BigInt @id @default(autoincrement())
  overrides Json?  @default("{}")

  @@index([id], map: "access_overrides_index")
  @@map("access_overrides")
}
")
@@index([id], map: "access_overrides_index")
}

Notice it seems to copy everything after the closing } character and repeat it minus the map.

I'm on the latest versions of PalJS and Prisma. Any help would be appreciated.

AhmedElywa commented 2 years ago

I already fixed this in the last version 4.0.14

ajhollowayvrm commented 2 years ago

Hmm I'm using this command npx @paljs/cli schema camel-case and this command pal schema camel-case on this version

VERSION
  @paljs/cli/4.0.15 darwin-x64 node-v14.17.4

and I'm still getting this error.

AhmedElywa commented 2 years ago

I forget to fix in one more place fixed in the new version 4.0.16