CareSet / DURC

DURC is reverse CRUD
MIT License
3 stars 2 forks source link

Support the detection of simple many-to-many. #22

Open ftrotter opened 6 years ago

ftrotter commented 6 years ago

Sometimes "middle tables" are just many to many relationships. This is true when they have just thinga_id and thingb_id. And also when they have thinga_id, thingb_id, created_at, updated_at, deleted_at...

But when they have another field like

friend_note or friendnote_id than they are doing more than just being many_to_many stuff... they need to be their own Eloquent Object, with two many_to_one relationships...

But if we can be sure that a table is truly just a many_to_many table, then it would be nice just to change the type of generated relationships between the two end tables and not have an eloquent class created for the central many_to_many table.

This is harder than it sounds and can wait.

-ft

ftrotter commented 4 years ago

not that the new data linker might be adopted to do this. It has a "three way" pairing with a tag, but perhaps it would be just better not to have the intermediate tag, and to support just two way linking. Of course, if you are doing that, then why not just have "tagging" support directly on both sides of any many to many relationship directly in DURC? Of course we could support both methods since the data results from each approach are identical in the end.