Collin
09/29/2022, 8:38 PMNurul
09/30/2022, 6:15 AMCollin
09/30/2022, 2:45 PMmodel oeHdr {
orderNo String @id(map: "pk_oe_hdr") @db.VarChar(8) @map("order_no")
deliveryInstructions String? @db.VarChar(255) @map("delivery_instructions")
oeHdrUid Int @unique(map: "ak_oe_hdr_uid") @map("oe_hdr_uid")
ship2Add1 String? @db.VarChar(50) @map("ship2_add1")
ship2Add2 String? @db.VarChar(50) @map("ship2_add2")
ship2Country String? @db.VarChar(50) @map("ship2_country")
ship2City String? @db.VarChar(50) @map("ship2_city")
ship2State String? @db.VarChar(50) @map("ship2_state")
ship2Zip String? @db.VarChar(10) @map("ship2_zip")
oePickTicket oePickTicket[]
@@map("oe_hdr")
}
model inv_tran {
transaction_number Decimal @id(map: "pk_inv_tran", clustered: false) @db.Decimal(19, 0)
trans_type String @db.VarChar(5)
document_no Decimal @db.Decimal(19, 0)
sub_document_no Decimal @db.Decimal(19, 0)
inv_mast_uid Int
inventoryReceiptsLine inventoryReceiptsLine[]
@@unique([document_no, inv_mast_uid])
}
Nurul
10/14/2022, 2:16 PMoeHdr
and inv_tran
models are of different type, prisma will throw an error stating that the ids should be of same type.
would i be better off creating a view within my database that converts sub_document_no to type stringYes, you can definitely try this approach, if both the ids are of string type then there shouldn’t be an issue.