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

  • Home
  • SEARCH
  • 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 4381634
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T12:40:26+00:00 2026-05-21T12:40:26+00:00

I just starting a project, I would like to have a small content manager

  • 0

I just starting a project, I would like to have a small content manager with version control. However I don’t know what is the best way to model the database.

I have content table which contains the following fields:
id primary key serial,
content_id int (field to identify diferent contents),
title varchar,
content longtext,
version int default ‘1’,
create_date date,

I have seen some CMS separes the revisions in another table than the actual revision, What’s the best way? Is there any optimized way?

Thanks!

  • 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-05-21T12:40:27+00:00Added an answer on May 21, 2026 at 12:40 pm

    I designed something like this and here’s the gist of it;

    1. I create mirror table for every table that I want to have row level version control. Let’s say you have CUSTOMER table. Your mirror version control table will be VER_CUSTOMER
    2. Every table that I want to have row level version control has a column called RECORD_ID (GUID)
    3. When a record inserted to that table, I generate new GUID and populate that field. New record also inserted into VER_CUSTOMER table with RECORD_ID as added to table’s natural PK.
    4. When record is updated, I generate new GUID again. Populate RECORD_ID with this new GUID. Updated record also goes to VER_CUSTOMER table.
    5. When record is deleted, I mark record on CUSTOMER table as DELETED (not physically delete the record). I have IS_DELETED column on every table. I set that column to TRUE when record is attempted to be deleted. Again copy of the deleted record also goes into VER_CUSTOMER table.

    So every transaction that you have on that table, you have a corresponding record in VER_CUSTOMER table with RECORD_ID and table’s natural PK as PK. For example if CUSTOMER table’s PK is CUST_ID. PK of VER_CUSTOMER will be composite CUST_ID and RECORD_ID.

    Hope this helps…

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

Sidebar

Related Questions

Im just starting a project and since this project is personal I was wondering
I'm just starting my first project in ASP.NET MVC. In my webforms experience, I
I'm just starting up a new ATL/WTL project and I was wondering if the
I'm just starting to use Django for a personal project. What are the pros
I'm working on a project and I'm just starting to do all the work
Just starting out in asp.net. Have just created a login.aspx page in my site
I am just starting out with DI & unit testing and have hit a
I know that there are no fixed rules about software version control but I
I am just starting up a new project that needs some cross-platform GUI, and
So my team is just starting to use branches on our project, and we've

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.