Database - Edit History
We have added an edit history system some time before, as any real wiki needs one. When users edit an article, it creates a new entry in the document_versions table. document_versions is the table responsible for keeping the edit history in the wiki. We can store this edit in the form of Text and Json artifacts in the table - so bigger footprint, but fast retrieval, or we can later choose to antiquate the item - which we will do with database management tools like Spark. We can store a version as text only, as text and json, and as delta only - depending on how fast we want to be able to restore the item versus how much space it will take to store in the DB. Probably older changes will be pruned to include only the delta, and newer will be stored in full. An antiquated item stores only the delta of the edit, thus reducing the storage space needed. And every entry in this table holds a reference to the previous edit and the next edit - so we can reconstruct history.
text - is the text version of the describe document - that is, the article.
json - is the compiled JSON version the describe document - that is, the article.
delta - is the difference between the previous version and this one.
edit_comment - the edit comment. Comment is a reserved word in SQL, by the way.
is_minor - whether the edit is a minor one.
document_id - links to the document id in the describe_documents table.
previous_version_id - link to the previous edit item, in a linked list fashion.
next_version_id - link to the next edit item, in a linked list fashion.
usercode - the user who created the edit.
created_at - time of creation.
antiquated_at - when was the newer edit created - or basically when this edit became not the latest one.
document_versions
.id
.text
.json
.delta
.comment
.is_minor
.document_id
.previous_version_id
.next_version_id
.usercode
.created_at
.antiquated_at
Links
Versioning
Subsystems - Main Data
Subsystems - Metadata (Housekeeping)
Subsystems - Accounts
Subsystems - Permissions (Authorization)
Listiary Wiki - Database
Site SubMap - Listiary
Back