paljs / prisma-tools

Prisma tools to help you generate CRUD system for GraphQL servers

Home Page:https://paljs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

ajhollowayvrm opened this issue · comments

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.

I already fixed this in the last version 4.0.14

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.

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