Skip to content

update Database seeding script for Next.js - #2338

Merged
m-abdelwahab merged 1 commit into
prisma:mainfrom
m-abdelwahab:update-seeding-section
Sep 17, 2021
Merged

update Database seeding script for Next.js#2338
m-abdelwahab merged 1 commit into
prisma:mainfrom
m-abdelwahab:update-seeding-section

Conversation

@m-abdelwahab

Copy link
Copy Markdown
Contributor

Describe this PR

The seeding script mentioned in the docs, doesn't work for Next.js + TS projects and threw an error. For more details, check out this issue

Changes

Update seeding script to work with Next.js

This script doesn't work anymore with Prisma 3

 "prisma": {
     "seed": "ts-node --compiler-options \"{\\\"module\\\":\\\"commonjs\\\"}\" prisma/seed.ts"
   },

After

   "prisma": {
      "seed": "ts-node -O {\"module\":\"CommonJS\"} prisma/seed.ts"
   },

What issue does this fix?

Fixes this issue

@m-abdelwahab
m-abdelwahab merged commit 1f029cc into prisma:main Sep 17, 2021
@janpio

janpio commented Sep 17, 2021

Copy link
Copy Markdown
Contributor

Did you test this script on Windows?
Did you talk to the team responsible for this script?

There were multitudes of bugs because previously the example used a script that did not work on some platforms. Just replacing this without any conversation or review is not very nice.

@m-abdelwahab

Copy link
Copy Markdown
Contributor Author

@janpio oh I'm really sorry I didn't know that this issue was related to something cross platform, I thought it was something generic. 馃槵

Should I revert the change?

@janpio

janpio commented Sep 17, 2021

Copy link
Copy Markdown
Contributor

All good. I now realize my response sounded a lot more terse than I wanted it to - too many issues in to short amount of time :D Lets finish this via Slack and see where we end up.

@janpio

janpio commented Sep 17, 2021

Copy link
Copy Markdown
Contributor

prisma/orm#9211 contained a link to a reproduction repository, and we could confirm this change makes it work on Windows as well - so seems all good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants