A
A
Agony63312018-04-29 19:42:53
MySQL
Agony6331, 2018-04-29 19:42:53

How is the article system with versions made on the example of the site 'Wikipedia' and the like?

I'm interested in the technical part in theory, how to implement this?
So far, I imagine it like this:
1. Create a table with the name of the article and the columns:
a. ID-articles;
b. Article title;
c. Article version;
2. I create another table and bind the table id to the article id from the first table.
a. ID-articles;
b. The name of the author of the article;
c. Article version;
d. date of publication of the article;
etc.
Well, I look if the version has changed, I replace it with a newer one, but what about those who correct it? It turns out constantly new lines in a DB to create, then id is reassigned?
Give a link if there are articles on this topic.
And how do professional developers solve this problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xmoonlight, 2018-04-29
@xmoonlight

One table is enough:
ID, Title, Content, Author/Owner, Editor, Created, Modified, Version, Parent version, URL, Type ("Draft" or "Published"
) new entry.
URL field - can only be corrected BEFORE THE FIRST draft is PUBLISHED. Then - it is not available for editing and is not displayed.
The "Type" field is always displayed, but can only have the "Published" status for ONE particular version of the article. It is she who will be displayed in public.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question