Refactoring schema
I have the following schema:
Both the logos and Attachment are the same thing: files. So I thought that maybe I should refactor it, into the same table, but then apparently I am forced to do this
Which seems like a waste, because now the model File will need to update, everytime there is a new model that references the file. It does not scale well.
What would be the best way to optimize my Schema?
2 Replies
Nobody?
table inheritance like this isn't directly supported in Prisma, but we have a pretty handy doc page about it: https://www.prisma.io/docs/orm/prisma-schema/data-model/table-inheritance
Let me know if you have any follow up questions from there
Table inheritance | Prisma Documentation
Learn about the use cases and patterns for table inheritance in Prisma ORM that enable usage of union types or polymorphic structures in your application.