upgrading from v5 to v6
Hi, hope whoever reads this is doing good.
I got this Prisma error after upgrading from v5 to v6.
The reason I upgraded is because I wanted to split my big schema into multiple
.prisma files inside a /models folder.
That part works fine — but the problem is that the new Prisma version doesn’t generate the client in node_modules anymore.
So I added this in my generator:
Now the client gets generated, but it looks like Prisma combines all my schema files into one big schema, and then it throws this error:
After that, when I try to use the generated client in my Node app, I get this error:
Not sure why, but it also affects my migrations.
When I run a migration, it acts like it’s creating everything from scratch, even though the tables already exist.
Not sure if that’s normal in v6 or if I messed something up.
Here’s my simple Prisma config file (can’t share full code for confidentiality):
So yeah, that’s what’s happening.
I just want to know:
* is this normal for Prisma v6 when using multi-file schemas?
* or is there something I should change so it only generates one client and doesn’t reset migrations?
Thanks in advance 🙏

2 Replies
You selected the bot's instantaneous insights. Let me compile your answer right away!
It’s not normal for Prisma v6 to throw a “generator ... cannot be defined because a generator with that name already exists” error or to reset migrations when using multi-file schemas—these are usually signs of a misconfiguration.
Key points to check:
1. Multi-file schema setup:
- Your
- With
- If migrations are being reset, it’s likely Prisma isn’t seeing your existing models (e.g., due to schema misconfiguration), so it thinks the DB is empty. Ensure all model files are included and the
- Point your config’s
- Your
prisma.config.ts should point to the folder containing all your .prisma files (not just a subfolder). For example, if your structure is:
Then your config should be:
This ensures Prisma picks up all schema files recursively, including the main one with your generator and datasource blocks. If you point to just prisma/models, it will miss schema.prisma and cause issues like duplicate generators or missing models [multi-file schema docs].
2. Generated client import:- With
output = "../generated/client", you should import the client using:
Make sure the import path matches your build output structure. If you’re running from dist/, the relative path may differ—double-check your build and import paths [client location docs].
3. Migrations resetting:- If migrations are being reset, it’s likely Prisma isn’t seeing your existing models (e.g., due to schema misconfiguration), so it thinks the DB is empty. Ensure all model files are included and the
migrations folder is at the same level as the main schema file [
multi-file schema docs].
Summary:- Point your config’s
schema to the parent folder (prisma), not a subfolder.
- Ensure only one generator block exists across all schema files.
- Double-check your import paths after build.
- The issues you’re seeing are not expected in v6 and are likely due to the above misconfigurations.
Let me know if you need more help!Was the Bot response helpful?