many to many and field names [message #521] |
Thu, 04 January 2007 11:10 ![Go to next message Go to previous message](/theme/default/images/down.png) |
interop
Messages: 45 Registered: October 2006
|
Member |
|
|
The convention here is that all primary keys are named 'id' (1 pk per table) and all foreign keys are named <tablename>_id.
Unless I'm missing something this convention looks to create a lot of extra work for me. In particular in the list2 transactions.
e.g. if I have the following tables: group, group_employee,
and employee where group_employee is the link table between group and employee. when I want to do a list2 employees of a particular group I have to modify the where clause in the _cm_pre_getData function and change 'id' to 'group_id'. Then it doesn't look like I can display groups of a particular employee because how do I know to change 'id' to 'employee_id' or 'group_id'?
So, My question: Is this convention going to cause me too many problems or did I miss something?
p.s. Changing the convention is not a problem- so if you recommend that let me know.
thanks
|
|
|