Saturday, May 2, 2009

Re: 1 model for multiple database tables

Shouldn't you use only one table instead of three? Table structure is
the same so you can add to it additional column called type which can
be null - posts, 't' - post_teams and 'g' for post_groups. In my
opinion this is the easier way to solve the problem if it is possible
to manipulate the table structure.

On May 2, 9:06 pm, Miles J <mileswjohn...@gmail.com> wrote:
> So I am building a forum system, that will be used for multiple areas.
> The table structure is as follows.
>
> posts
> posts_teams
> posts_groups
> topics
> topics_teams
> topics_groups
>
> For example, all the posts tables are identical, except for the fact
> that posts_teams is only teams posts, and posts_groups is only for
> groups.
>
> I want to be able to use only ONE model (posts) that can manipulate
> all 3 tables. Since they are all the same data and structure, I don't
> want to have duplicate a single model 3 times. Is there a method for
> this already, or a behavior?
>
> If not I think ill go ahead and develop one.

--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: