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:
- Point Prisma to the folder, not a single file
If your structure is:
prisma/
schema.prisma // has datasource + generator
models/
user.prisma
company.prisma
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:
import path from 'node:path'
import type { PrismaConfig } from 'prisma'
export default {
schema: path.join('prisma'),
} satisfies PrismaConfig
Or in package.json:
{
"prisma": {
"schema": "./prisma"
}
}
Or via CLI:
npx prisma generate --schema ./prisma
- 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]
- 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:
prisma/
migrations/
schema.prisma
models/
user.prisma
company.prisma
[Schema location]
- 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