I would like to change the name and location of the prisma folder. Currently it called prisma and it sits on the root folder of my nextjs project. I'd like to name it db and have it within the src folder. Is that possible? If so, how?
Asked
Active
Viewed 4,297 times
1 Answers
9
The prisma docs explain how to do this: https://www.prisma.io/docs/concepts/components/prisma-schema#prisma-schema-file-location
For my particular situation, I added the following code to package.json
:
"prisma": {
"schema": "src/db/schema.prisma"
},
That changed the location to a folder called db
inside of the src
folder. I tested it out it works exactly as I wanted -- migrations and all.

Moshe
- 6,011
- 16
- 60
- 112
-
where exactly to put this code in package.json? under the root? – busaud Feb 13 '23 at 11:53
-
you can put it as another key in package.json: example: { "scripts": ... "prisma": { "schema" : "
" } } – the_only_sa May 30 '23 at 03:08