[eluser]NachoF[/eluser]
I have a question about database design.... Since Datamapper requires that each table have its own id field... how do you usually set up your many to many relaionship tables?? for instance... if you have employees and departments in a many to many relationship... I understand that the table departments_employees would have
id, employee_id, department_id but... which of those three fields would be primary key??... logic tells me it should be id but wouldnt that make the database corruptible?.. allowing the same employee and the same department to be related more than once??... I would usually have that table with only employee_id, department_id and both as primary keys and foreign keys (with InnoDB contraints)thus making it impossible for an employee/department to be related more than once..... I hope Im making myself clear here... thanks in advance.