Let's say your tables are Article and Article_Data with the Article containing fields like who created it, when it was created, last edited, current revision ID plus any other fields you want to store about it. Article_Data will contain revision ID, Title
and Content. You can maintain a single instance of "Article"...ie the Article will only exist the once for the purposes of your data retrieval, searching etc, you're never going to get 5 versions of the article in search results...but what is held multiple
times is Article_Data. So when you need to show a summary of your article you join Article and Article_Data on article_ID and live_revision, but your admin tools can show all instances of Article_Data and let you amend/publish/unpublish etc.
AidyF
Star
9204 Points
1570 Posts
Re: revision of an article in a blog
May 16, 2012 08:38 AM|LINK
Let's say your tables are Article and Article_Data with the Article containing fields like who created it, when it was created, last edited, current revision ID plus any other fields you want to store about it. Article_Data will contain revision ID, Title and Content. You can maintain a single instance of "Article"...ie the Article will only exist the once for the purposes of your data retrieval, searching etc, you're never going to get 5 versions of the article in search results...but what is held multiple times is Article_Data. So when you need to show a summary of your article you join Article and Article_Data on article_ID and live_revision, but your admin tools can show all instances of Article_Data and let you amend/publish/unpublish etc.