It's a smart way to design your DB and works really well for simple
tables such as comments.

I think the main thing is to try and create all the fields that every
kind of comment would ever need at the outset. In that way you will
ascertain that the fields are similar enough to keep the data in one
table and you won't have to keep adding extra fields later, although
of course you can always do so if you've forgotten something.

For example,  for Blog comments you might foresee a requirement that
people would like to rate the blog entries.  Therefore make sure you
have a rating field even though this might never be used or exposed
for News comments.

As always with DB design,  a few extra minutes planning can save days
of trouble and re-factoring later on  :-)


On Sep 6, 10:43 am, luigi7up <[EMAIL PROTECTED]> wrote:
> hola everyone,
>
> while developing application something crossed my mind. What about
> organizing all comments throughout  application in one database table.
>
> What I mean is this:
>
>  If application has some kind of Blog, News, picture gallery you woul
> create blog_comments table, news_comments table etc.
> What about table creating one table that would hold all comments ?!?
> Table comments would have following fields (id, model_name, item_id,
> author, text)
>
> This table would get pretty huge very soon but there is some logic in
> this approach :)
>
> What do you think?
>
> thanks
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to