Multi Schema files not being detected in ElysiaJS
I have a setup in ElysiaJS where my schema files are inside a directory called models, this has worked all along until Prisma 7, now my data models from other schema files are not being detected in
schema.prisma when I generate.
Below is just an example
2 Replies
You opted for speed from this bot. Let's conjure up an answer right now!
This is almost always a schema location / config issue with the new multi-file setup, not with ElysiaJS itself.
From the docs and related issues, for multi-file schemas to work in Prisma 7 you must:
1. Point Prisma to the folder, not a single file
If your structure is:
your config must point to the
prisma folder (or whatever folder contains schema.prisma), not to schema.prisma itself. [Schema location]
For example, using prisma.config.ts in your project root:
Or in package.json:
Or via CLI:
2. Ensure datasource is in a file in that folder
schema.prisma (or another file in that folder) must contain the datasource block; Prisma then recursively loads all .prisma files under that folder. [Schema location]
3. Place migrations next to the datasource file
If you’re using migrations, the migrations directory must sit next to the file that has the datasource:
[Schema location]
4. Common pitfall from issues
If you only point to ./prisma/models (or to schema.prisma directly), Prisma will not see the other files correctly and relations like company Company won’t resolve. You must give the folder that contains the main schema file. [[Multi-file invalid](https://githu
b.com/prisma/prisma/issues/27495); Multi-file not found]
If after adjusting the config your models are still not detected, the knowledge sources don’t provide more Prisma‑7‑specific changes; in that case I’d double‑check that you removed any old prisma.schema setting that still points to a single file and open an issue with a minimal repo.
✅ Great, thanks for letting us know that this solved your question!is this solved?