Topic: help me slim down my database (for fun and profit?)
no, but you want to help anyway
Lets say I have a Project model. The Project has one Leader, and many Employees. There is also a Person model which has many Leaders and Employees (different roles the Person plays on different projects). There is one other model called Tool. Tool has many Employees and Leaders (the things they use on the project). Also, the Employee and Leader have unique attributes for each project (think of them as roles on that specific project and what Tools they are using).
What I have done is made a Project model, Leader model, Employee model, Person model, and a Tool model. What annoys me about this is there are loads of Employee entries since each project can have more than one employee obviously, and every new project makes new employees that essential point back to some of the same Person objects, but I can't see anyway around it because an Employee has some unique properties for each Project. Secondly, trying to find an employee's name by Project.Employee[index].Person.name is a bit much and not very DRY. Another thing that is annoying is trying to find projects a person is related too. For example, Person.Leaders.Projects obviously doesn't work.
I thought I had found an answer with polymorphic associations but really that only solved the data access issue. It still doesn't address the ridiculous amount of employee records I end up with that really don't contain a whole lot of worthwhile data.
Any suggestions would be helpful. I could be going about this completely the wrong way. If you want more information, just ask.
Last edited by b4t3m4n (2007-03-14 18:20:04)