Closed jawadst closed 1 year ago
Good point. Let me think about where to add such a setting. It can be translated as a @map
in Prisma schema.
I think we can introduce a zenstack.config.json
file to configure this behavior globally. Will include it in the next release.
Hey @jawadst , I've worked on a PR to add a zenstack.config.json
file for CLI settings, right now only include the customization you need. The file is optional but can be created as follows:
{
"guardFieldName": "myGuardField",
"transactionFieldName": "myTransactionField"
}
With this, the Prisma schema generated will be:
model Foo {
...
zenstack_guard Boolean @default(true) @map("myGuardField")
zenstack_transaction String? @map("myTransactionField")
}
Does this look good to you?
In the future we may change the field to camel case by default, but I think we should probably do it on a major release since it causes a new db migration.
@ymc9 Looks perfect, thanks a lot!
Fixed by #340
Is your feature request related to a problem? Please describe.
We usually name our columns with
camelCase
rather thansnake_case
Describe the solution you'd like
The ability to specify the name of the
zenstack_guard
field via an attribute in the Zmodel would be great