CodeIgniter Forums
database structure for content types - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: General Help (https://forum.codeigniter.com/forum-24.html)
+--- Thread: database structure for content types (/thread-75011.html)



database structure for content types - GHM - 12-07-2019

Hi, We have 5 or 6 content types, for example:
Articles
Forums
podcast
Videos
shop
and ...

separate table for them? or one node table (according to "type" field) for all content type?

this system is user centric and have a comment table for all content types.

please guide me how to design this database. Thanks


RE: database structure for content types - jreklund - 12-08-2019

It depends on what type of content you are going to store about the different things. Are you for an example making 10 different types of articles (news, contests ...), store them as article.

In your case, separate tables.


RE: database structure for content types - GHM - 12-08-2019

(12-08-2019, 02:07 AM)jreklund Wrote: It depends on what type of content you are going to store about the different things. Are you for an example making 10 different types of articles (news, contests ...), store them as article.

In your case, separate tables.

news, articles and the like them... saving the article table.
But I don't know structure for forum, video, podcast and shop.

But i can create a "node" table for all content types and Separate by the "node_type" field.


RE: database structure for content types - vincent78 - 12-08-2019

Hello,

The best is to have one abstract table 'Content' and some concrete tables 'Article', 'Forum' ... that inherit from 'Content'.

If an association involves all Contents, you link it to the table 'Content'.
And if an association involves only the Articles, you link it to the table 'Article'.

I've created an ORM that manages it:
https://github.com/vmoulin78/concorde

Vincent