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?
Changing Name & Location of the Prisma Folder in Prisma 2
The prisma docs explain how to do this: https://www.prisma.io/docs/orm/prisma-schema/overview#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.
where exactly to put this code in package.json? under the root? –
Bills
you can put it as another key in package.json: example: { "scripts": ... "prisma": { "schema" : "<your-path>" } } –
Sievers
© 2022 - 2024 — McMap. All rights reserved.