paljs / prisma-tools

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

Error in camel case type relation generating #282

Open ginkenta opened 2 years ago

ginkenta commented 2 years ago

In case of generating relation with table named in snake_case the type isn`t generated properly. To check you can specify the table with snake_case in relation field, for example with pgm: pgm.createTable('some_table', { ..., some_field_id: { type: 'uuid', notNull: true, references: '"another_table"(id)', })

another_table type reference won`t generated properly.

To convert it was used the next command yarn run pal schema camel-case --schema=<path to my schema>