kirk112 Posted September 15, 2011 Share Posted September 15, 2011 Hi I am trying to design an article website and have got a mental block over the best way to design the database, I have attached a screenshot of the current design (please ignore the column types), I will try to best explain the problem below, please let me know if you need any additional information An article can be in any number of categories (article_to_category table) all the articles have set values which are stored in the article_content. Depending on the type of the article it can have additional attributes which are stored in the report, article, event, viewpoint tables. The problem is there is not direct link between the article_content table and the attributes in the above tables, I would have to union all the tables together and workout which of the values I need to display. I have looked at a EAV model and feel it's not the correct way to go. I have thought about combining the report, article, event, viewpoint tables into the article_content and making the column NULL but this feels 'wrong'. Thanks for your advice, please let me know if you need any further explanation [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
fenway Posted September 15, 2011 Share Posted September 15, 2011 Why don't those additional tables have an article_uid? Quote Link to comment Share on other sites More sharing options...
kirk112 Posted September 15, 2011 Author Share Posted September 15, 2011 Thanks for the reply, They all have a article_content_id, and if I select an article from report, article, event or viewpoint I will be able to join the article content and other related information, but if I do a search on the article_content table I will not know which table to join to it as it can be 1 of 4 Regards Quote Link to comment Share on other sites More sharing options...
fenway Posted September 16, 2011 Share Posted September 16, 2011 But that's always the case, whether it's 1 table or 4 -- you can't know what's in the other table until you look. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.