Issue with custom table names
I've added such custom table names so it matches my db schema:
And I've found an issue:
when I run
npx @better-auth/cli generate
it generates me such migration file:
So the issue here is that it wants to create columns with camelCase, even though I indicated I want them snake_case (banReason: 'ban_reason'
-> ban_reason: 'ban_reason'
didn't help neither)3 Replies
When it comes to overriding additional fields (created by plugins). You will need to pass the field map (schema) to the plugins schema property.
For example the admin plugin adds “banReason” so you will need to pass:
You can view the admin plugin schema here.
https://www.better-auth.com/docs/plugins/admin#schema
okay, for email plugin it works as expected, but I'm also using
emailHarmony
plugin from better-auth-harmony
and there is no option change. Any idea what to do in this case?I had a quick look and that plugin does not support overriding fields.
I recommend creating an issue or implement the functionality.
The api-plugin is a good one to see how it's implemented.
In summary before returning the schema you should merge the schema with the custom options