-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EPIC: re-design of db seed
feature
#8732
Comments
It's possible to try it out with a specific version of the Prisma CLI like this:
Or by using npx with the specific version:
|
Note this will work and is cleaner IMO: "prisma": {
"seed": "ts-node prisma/seed"
} |
May I suggest that the error handling part (copied from the above example)
may be moved to Prisma's cli code, i.e one only exports the |
Hi @tobiasdiez indeed, exiting is not the best in some cases. This is just an example and in this implementation you are free to change it as you need. |
Closing, rest is tracked in #8628 I'll create an issue to have better suggestion for ESM module projects help output. |
prisma db seed
is currently a Preview feature.During this phase, we noticed different issues caused by the complexity of the current implementation.
The Migrations Team decided to remove the complexity and make it a lot easier to understand for users and to maintain.
The new implementation is in #8146
How it will work is that a
prisma.seed
property in thepackage.json
of your project will be required if you want to useprisma db seed
.The CLI will give examples that can be copy-pasted.
If you are currently using the previous implementation of
prisma db seed
and upgrade to this new version then it will throw an error with an upgrade help message which should be easy to fix (addprisma.seed
to thepackage.json
)package.json
example for a JavaScript projectpackage.json
example for a TypeScript projectExample of a
prisma/seed.js
What needs to done for releasing the "new"
db seed
:db seed
GA docs#2161db seed
tests need to run on multiple platforms, not just Ubuntu #8033The text was updated successfully, but these errors were encountered: