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.

Separate prisma files to manage models

See original GitHub issue

In prisma1, I used to import multiple datamodels in prisma.yml like below.

  - datamodel.prisma
  - datamodel2.prisma
  - datamodel3.prisma

How can I do this in Prisma2 when there is only one file project.prisma when I generated the boilerplate.

image

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:41
  • Comments:27 (7 by maintainers)

github_iconTop GitHub Comments

29reactions
EndyKaufmancommented, Jan 8, 2020

I write on nestjs and use modular architecture, i want separate prisma schema for each module, i want this feature 🙏

28reactions
nikita-fuchscommented, Mar 23, 2021

Two years later, a team of 10 still has to mess around in 1 schema file. What could possibly go wrong.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to split Prisma Model into separate file? - Stack Overflow
I can recommend 3 solutions though. Option 1: Prismix. Prismix utilizes models and enums to create relations across files for your Prisma schema ......
Read more >
How to use Prisma with multiple database schemas
To use multiple database schemas in your Prisma schema file, add the names of your database schemas to an array in the schemas...
Read more >
Work with Models and Relations with Prisma Schema
In this lesson, we will learn how to model data relationships with Prisma Schema. We will be using a social network as our...
Read more >
[Prisma2] Is declaring all the models in one file a big ... - Reddit
What you should do it split it into 3 backend apps each for it's respective domain- CMS, eshop and third one for storage...
Read more >
Data Modeling with Prisma - JavaScript in Plain English
Generated migration file looks like this. Migration SQL generated for User manage User one to many relationship. Many-to- ...
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