Moshe
Moshe

Reputation: 6991

Changing Name & Location of the Prisma Folder in Prisma 2

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?

Upvotes: 7

Views: 8847

Answers (1)

Moshe
Moshe

Reputation: 6991

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.

Upvotes: 18

Related Questions