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 (
I tried it earlier and got an error.
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.
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.
