question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Prisma seed - add config for custom seed.ts file path

See original GitHub issue

Prisma 2.15.0

I have folder structure:

  • package.json
  • schema.prisma
  • seed.ts

When I run prisma db seed --preview-feature it says Create a seed.ts, .js, .sh or .go file in the prisma directory..

But I have prisma as a package with custom build dir so when I want to get prisma seed working I need to create another prisma folder and put seed.ts in it.

It would be greate to specify seed file path like prisma db seed --path ./seed.ts --preview-feature

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
mittalyashucommented, Sep 11, 2021

How to set custom path for prisma seed file? (not for prisma schema)

1reaction
homokycommented, Feb 9, 2021

@janpio It works out of box, noo need to specify the path. In new prisma version this is fixed with --schema flag:

prisma db seed --preview-feature --schema=./schema.prisma
Read more comments on GitHub >

github_iconTop Results From Across the Web

Seeding your database - Prisma
Learn how to seed your database using Prisma's integrated seeding ... In the seed.ts file, import Prisma Client, initialize it and create some...
Read more >
prisma db seed & typescript problem with import and type ...
Try and double-check your seed command in the prisma section of your package.json, it should look like the one in the repo of...
Read more >
How to seed a database with Prisma and Next.js - PlanetScale
In this tutorial, we'll see how to seed a PlanetScale database using Prisma in a Next.js project. Check out the Prisma quickstart for...
Read more >
Command Line Interface | RedwoodJS Docs
Create a Redwood project using the yarn create command: ... you can off-load long running tasks; Custom seed scripts for your application during...
Read more >
Jokes App Tutorial - Remix
You can programmatically create routes via the remix.config.js , but the more common way to create the ... We do this at the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found