P
Prisma2w ago
Luigi

Still not solved: Prisma can't find multi-file-separated models in 6.14.0

I am on version 6.14.0, followed all the instructions to add a typescript config file and remove the package.json instructions and ended up with this setup where it is not finding any of my models and it just dropped all my tables when migrating. Here is my setup: This is my exact file structure:
yda-web/
├── prisma/
├── schema/
├── user.prisma
├── notification.prisma
├── schema.prisma
└── prisma.config.ts
yda-web/
├── prisma/
├── schema/
├── user.prisma
├── notification.prisma
├── schema.prisma
└── prisma.config.ts
prisma.config.ts
import path from "node:path";
import type { PrismaConfig } from "prisma";

export default {
schema: path.join("prisma", "schema"), // This points to the folder
} satisfies PrismaConfig;
import path from "node:path";
import type { PrismaConfig } from "prisma";

export default {
schema: path.join("prisma", "schema"), // This points to the folder
} satisfies PrismaConfig;
schema.prisma generator client { provider = "prisma-client-js" } datasource db { provider = "postgresql" url = env("DATABASE_URL") }
prisma.schema
prisma.schema
generator client { provider = "prisma-client-js" } datasource db { provider = "postgresql" url = env("DATABASE_URL") } `` I've also renaming ./models to ./schema` and moving migrations and schema.prisma into it, which led to the same result with all tables dropped on the following migration Please help
6 Replies
Prisma AI Help
You decided to hold for human wisdom. We'll chime in soon! Meanwhile, #ask-ai is there if you need a quick second opinion.
Nurul
Nurul6d ago
Hey! Just to confirm, does this issue occur only when you have split your schema file? For testing, if you do not split and have only one schema.prisma file, then it works correctly?
Luigi
LuigiOP5d ago
yes, with this exact setup when I move the models to the schema.prisma and delete the separate model-files, the issue does not occur and all the tables get created like they shoudl but I would like to use this multi-file feature Please, I have been trying to do this since beginning of July
Nurul
Nurul5d ago
Thanks for confirming. Can you please create a GitHub Issue via this link: https://github.com/prisma/prisma/issues I'll share it with ORM team internally
Luigi
LuigiOP4d ago
GitHub
Prisma can't find multi-file-separated models in 6.14.0 · Issue #2...
Bug description I am on version 6.14.0, followed all the instructions to add a typescript config file and remove the package.json instructions and ended up with this setup where it is not finding a...
Luigi
LuigiOP4d ago
Thank you Nurul for sharing it internally!

Did you find this page helpful?