Use foreign key as primary key
I've implemented multi-table inheritance following your guide: https://www.prisma.io/docs/orm/prisma-schema/data-model/table-inheritance#multi-table-inheritance-mti
My question: Is it possible to merge the foreign key and primary key on my child table? It's easier to query if the parent table (
User
) and child table (Admin
) have the same id. But duplicating the ID is not great because it introduces room for mistakes.
I tried it earlier and got an error.
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.
3 Replies
Hi @Florian
This is currently not possible with Prisma.
Thank you for the response!
You’re welcome