You may consider not making a field "leader", but a field "role", so that you can assign possible future roles, that members may play in a project - example: manager, coder, analyst, designer, technical writer, etc.
Enjoy, John On May 7, 3:59 pm, MinaTSU <mina...@gmail.com> wrote: > Hello everybody! > > First post. > CakePHP newb! > Apologies beforehand if this was answered beforehand. > (I did a search with no success). > > Here is the problem I'm facing: > > I'm designing the database of a new site. The site is to host several > projects. People in order to join projects first have to register at > the site. > > * Registered users exist in the "users" table. > * Data related to the projects exist in the "projects" table. > * Each project has its members and at least one project leader. > * At minimum, each project has one leader. > * Project members and leaders are taken from the set of registered > users. > * Each user can be a member and/or leader of several projects. > * Project leaders can add/remove members from their projects. > > The closest example of an existing site that resembles the site I'm > designing is sourceforge.net. At sourceforge registered users can be > members of several projects and also can start their own projects and > hence become project admins. > > This is how I'm thinking to tackle the problem I'm facing: > Create a "users" and a "projects" table. Create a HasAndBelongsToMany > relationship between the two. Add an extra field to the Joint table > ("projects_users", following Cake's name convention), and call it > "leader". Make that field a boolean, default value 0. > If a member of a project is a leader then change the value to 1. > > Is that approach a good one? Will I encounter any problems? > Did anybody had a similar problem in the past? How did you solved it? > > Thanking you all in advance for the help! > > MinaTSU --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---