This should be a simple Yes/No answer so here goes.
If I set a 3 tables, 2 typical recordsets and 1 that joins them by the id of the 2 tables, do I need the id from both tables in order to have an entry in the join table?
The scenario is a Jobs table and a Parts table linked by JobsParts table. But some parts are not in the Parts table, they are just freetext entries (so as to avoid stock control issues) belonging to a Job.
Hope this is enough to explain my question.
Thanks
BTW using CakePHP 2.0
For database sanity, I’d say the join table ‘jobs_parts’ should have both IDs.
If you try entering free-form parts into the join table, you’re not only going to increase the size of the join table, but you’ve effectively lost the ability to grow/expand – ie. what if you want to add a few more fields to this unknown part? Or what if it turns out to be a part that you actually want in your normal parts table…. it just gets confusing.
There are other options for dealing with free-form parts vs actual parts…
In my opinion, go with what makes logical sense for ease of understanding and for future updates to your database/website…etc. And IMO, adding a freeform part into the join table would not fit that bill.