Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8933043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:26:40+00:00 2026-06-15T09:26:40+00:00

For a project I am making I need the possibility (like stackoverflow does) to

  • 0

For a project I am making I need the possibility (like stackoverflow does) to save all the previous edit (revisions) for posts.

Consider I can have some 1 to N association with the post (for example 1 post with 5 images associated).

How would you suggest me to design the database for this?
Of course the ID of the post should stay the same to don’t broke URLs:

site/post/123 (whenever revisions it is)

Each revisions to posts should be manually approved so you can’t show directly the last revisions inserted. How would you suggest me to design the db?

I have tought

Table: Post
postID | reviewID | isApproved | authorID |  text

And the image table (for example image, but it could be everything)

Secondary Table: Image
imageID | postID | reviewID | imagedata
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T09:26:41+00:00Added an answer on June 15, 2026 at 9:26 am

    Actually, I would split the post table in two, with the approved revisions in one, and the latest (not approved) revision in another. The rational is that any non approved revision which is not the latest would be supersceded by the next one (unless you really want to keep track of all the intermediate modifications, approved or not).

    Table: OldPost
      postID | reviewID | authorID |  text
    
    Table: PendingPost
      postID | authorID |  text
    

    In that layout, whenever a new revision has been approved, it must be moved to the approved ones, but you don’t have to filter them out when displaying the whole history, and conversely, you wont have to filter the approved revisions in the approval part of your site.

    You could even refine the layout with yet another dedicated table for the latest approved revision (so three tables for the post in total, not counting attachements). This partitioning would improve the overall performance of your site for the most common queries, at the cost of more complex queries when you need all the data (less frequent operations).

    Table: CurrentPost
       postID | authorID |  text
    

    As you can see, this table structure is the same as the one for pending posts, so the updates would be trivial.
    moving a revision to the old post table requires to find out the revision count, but you would have to do that operation anyway with a more classic db layout.

    Regarding the attachment table, the layout seems to work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have searched all over the web with no luck of making this project
for the project i am making I need a WCF webservice that is secured
I am making one project where i need to display Home page and when
I'm currently making a project where I need to print out a receipt on
I'm planning on making an editor for my current project and will need some
Making an uno game for a project. all 108 cards are located in a
I am making a project where I need to make a customised spinner where
All, I have a ASP.NET Web API project that is making a REST call
I'm making a google maps project and need to create a route clicking on
I have this school project I'm making, where I need to make my code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.