myydraal
myydraal
DTDrizzle Team
Created by jakeleventhal on 1/18/2024 in #help
How do you define one-to-one relations in the same table?
If you just want one table - you don't need to define a relationship at all - the fact they are in the same row is the 'relation' by itself. relations are only meant for joining two tables
21 replies
DTDrizzle Team
Created by jakeleventhal on 1/18/2024 in #help
How do you define one-to-one relations in the same table?
do you have a table for digital listings? it doesn't make sense for a table to reference themselves as the point of a reference is to provide a joining point between two tables. I am not sure what you were doing in prisma did anything either? I think what you want is either a new field - so a table that has digitalListing, physicalListing as the two fields in a row, as it seems like you may always want that relationship - Otherwise, you want two tables - a physical listing table and digital listing table, each with relavent fields, and then each referencing the other by their unique id
21 replies