Hello I have a table that has a compound `primary...
# orm-help
w
Hello I have a table that has a compound
primary key
Copy code
create table shipment_entry_detail (
	shipment_entry_id uuid
	shipment_entry_detail_id int
	notes text
);
I also have a trigger that populates the
shipment_entry_detail_id
which is a sequence based on the rows of
shipment_entry_id
. It works perfectly but the prisma client expects the
shipment_entry_detail_id
to be populated by me, is there a way to tell prisma that I GOT IT? (😅)
👀 1
n
Hi William 👋 Have you defined the composite primary key in the
schema.prisma
file?
w
I introspect my database, so it should be there. Let me take a look 👀
Yes I do
@@id([shipment_entry_id, id], _map_: "PK_Shipment_Entry_Detail__shipment_entry_id__id")
a
Can you try making the field optional in your
schema.prisma
?
Copy code
shipment_entry_detail_id  Int?
w
Yes, but everytime that I introspect, it will be overwritten, Kind of a bummer!