Migrations and Build breaking after the new version of 6.6.0
From today morning, we are unable to deploy our services, intially we had issue of schema not found, rectified that issue based on the solutions on web. Now its not properly working with the seed.
Can anybody help whether 6.0.1 is deprecated?
Which version would be better suitable with minimal changes to migrate?
Thanks π
7 Replies
You chose to compile with the bot. One moment while I piece together your answerβ¦
Based on the knowledge sources, I can provide some information about your issue with Prisma 6.0.1 and 6.6.0.
Prisma 6.0.1 is not deprecated. Prisma follows Semantic Versioning (SemVer) starting from version 3.x.x, which means that within the same major version (6.x.x), minor version updates (like 6.0.1 to 6.6.0) should only add backward-compatible functionality or fix bugs in a backward-compatible manner Link to Prisma versioning docs.
Regarding your seed issue, in Prisma 6.6.0, there was an update to how the migrations folder is searched for in relation to your schema files:
1. If you want to read schema files from a folder, you must explicitly pass the path via either:
- The
--schema
CLI argument
- The package.json prisma.schema
field
- The schema
property in prisma.config.ts
2. Prisma will search for the migrations folder next to the schema files that contain the datasource
block (usually your main schema file directly in the specified schema folder) Link to GitHub issue.
For seeding, Prisma expects a prisma.seed
property in your package.json
. For example:
- For JavaScript: "prisma": { "seed": "node prisma/seed.js" }
- For TypeScript: "prisma": { "seed": "ts-node prisma/seed.ts" }
To migrate with minimal changes, I would recommend:
1. Make sure your package.json
has the proper seed configuration
2. Ensure your schema files and migrations folder structure follows the expected pattern
3. If you're having issues with the folder structure, consider moving your models to a prisma/schema
folder as mentioned in one of the GitHub issues
If you want to stay on a more stable version while you sort out these issues, you could consider using Prisma 6.3.1 which is more recent than 6.0.1 but predates the 6.6.0 changes to schema and migrations folder handling.
The knowledge sources don't provide specific information about other
issues you might be facing, so if you're encountering different problems, you might want to provide more details about the exact errors you're seeing.
π€ Alright, thanks for letting us know that there's still some help needed. A team member will reply to you shortly.
In the meantime, please let us know any additional info, questions, or which parts of the answer may need clarification.this change now shows
No migration found in prisma/migrations
while building
Is moving migrations into the schema folder the only way? @Prisma AI Help
Thanks for the help, I was able to fix my issue by upgrading to
6.3.1
If I could suggest, it would be nice if we have a new migrations
field to existing prisma object in package.json
this way, we can have a good folder out look, instead of having migrations folder amongst the prisma files
Thanks πHey π
To confirm my understanding, you upgraded from version 6.0.1 to 6.6.0 and it caused the previously working build to fail?
While upgrading to prisma version 6.3.1 instead of 6.6.0 resolved the issue?
No, I never updated to 6.6.0 version
When prisma released v6.6.0 which happened today, our build pipeline, started to break
Then after many git issues and community search here in discord, I moved my version from 6.0.1 to 6.3.1
I did made few changes
- adding schema folder path in package.json
- moving migrations folder into schema folder where data_source prisma is saved [this change fixed the issues, but long run doesn't seem to look good for me, from folder managing pov, would highly support for the suggestion I made, above]
There is an open issue about this matter here: https://github.com/prisma/prisma/issues/26840
Please be noted this occurs for users who are using
prismaSchemaFolder
preview flag
ThanksGitHub
Prisma 6.6.0 does not work with
prismaSchemaFolder
Β· Issue #2684...Bug description Prisma does not recognize schema folder in v6.6.0 # migrations folder hidden for brevity β― tree prisma prisma βββ schema β βββ config.prisma β βββ devops.prisma β βββ index.prisma β...
I assume you would have already followed the conversation in the GitHub Issue, but I'll still share here
This was an intended breaking change:
https://www.prisma.io/docs/orm/prisma-schema/overview/location?utm_source=github&utm_medium=optimize-readme#multi-file-prisma-schema-preview
Prisma Schema Location and Configuration | Prisma Documentation
Documentation regarding proper location of Prisma Schema including default naming and multiple files.
Thanks @Nurul
No worries π