4 ms·
So the relations must be stored somewhere. I'm guessing a join table that includes the table names of each record, ie a 'polymorphic' join table?
by jacknews 3y ago
So the relations must be stored somewhere. I'm guessing a join table that includes the table names of each record, ie a 'polymorphic' join table?
- tie-in 3y agoYou've guessed it right :) An entry in the relationship table looks something like this: { "id": 6, "sourceComp": "user", "sourceId": 2, "targetComp": "post", "targetId": 3, "type": "author", "createdAt": "2024-03-28T13:28:59.175Z", "updatedAt": "2024-03-28T13:28:59.175Z" }