How to write my schema? #24200
Replies: 1 comment 1 reply
-
Hi @ElBaraaRadwan 👋 In your old schema, you have separate models for This is different from your new schema where you have a single |
Beta Was this translation helpful? Give feedback.
-
Question
I'm trying to write a schema using Prisma, but I keep running into a problem if design and relations between models.
This is the current schema that I'm using
and this is the OLD schema
the problem that I keep running at
1- is the self-relation in explicit way is correct or am i doing it wrong
2- the connection between models in the function is not visible any more alike the OLD schema
so is i started to have a doubt about this schema and should just get back to the old one but it has its own problem to, like
duplicated lines in the schema that result to more function and routes for handling every model.
not mentioning how hard it is to handle the relation between them.
So, what should i do to solve this confusion?
what should i do to make a better version of my schema for handling relations and not to have duplicated lines and functions/routes?
Beta Was this translation helpful? Give feedback.
All reactions