Hello all. Does anyone have any experience convert...
# orm-help
c
Hello all. Does anyone have any experience converting SQL Server Column names from Pascalcase to Camelcase? It is an existing DB that cannot be modified. I have done some searching online and can't seem to find an efficient solution. Any help would be greatly appreciated.
a
There's a thread just above about renaming database columns within Prisma
This doesn't actually change your database but does mean the userland code you write can use whatever names and cases you prefer
c
Thank you for the quick reply!
I went down that road but the changes did not seem to have any effect. I will try again.
Is there a way to change them automatically? Rather than putting
@map('string')
on every column?
a
you may need to run prisma generate after you make schema changes
👍 1
no -- no way to automatically make things! Unless you make some kind of script that modifies your schema programmatically
c
Thank you for responding. I will go the script route found here. https://github.com/prisma/prisma/issues/1934
I cannot get
@map()
to work at all
schema file
Then I run
yarn prisma generate
Then a
.prisma/client
folder is generated in the node modules folder with the same column names
Any ideas?
Seems like
prisma generate
is ignoring the @map()