简体   繁体   中英

Build article/document versioning system as in Joomla

I am building a web application and my client wants be able to look at original reports that are coming to the app (reports gets eventually changed by project leaders at my clients company). I am guessing that they will in the future want to see even more information, like every change and who did what during the process from original to final report. That is why I am considering to implement versioning system for all reports, so they can track all changes back to original report.

I have been using Joomla for a long time and I like their approach to build their database, so I wonder if there is someone who is familiar with how Joomla solved this in their database. I could see that they have separate table called: ucm_history. Is it the only thing they have in database in order to track old version of articles?

If somebody could help me to describe best practices of versioning, I would be very thankful, and I am sure that it would be helpful to lot of other people as I see this coming in more and more apps.

Yes, all of the version data is slammed into that one table.

The sha1_hash column is quite a clever piece of data to store in my opinion because it allows a very quick assessment of what is unique (after the initial character_count check of course) without having to scan an ever-growing number of content rows that could be tens of thousands of characters each. Identifying unique content is vital in avoiding unnecessary table bloat.

The most noticeable drawback with the ucm_history table ( Unified Content Model in case anyone is wondering) is that you can't easily call any meaningful queries on the content data because it is all converted to json.

The ucm_history table is purpose-designed and the point/goal of its existence is storage ONLY. To processes the data, it must be pulled out entirely then have the json data parsed.

If this is sufficient for your project, go ahead and construct your own clone of the code/db ...after all, it's open source!

I have a few concerns about how Joomla's version popup modal works (lights on / lights off when scrolling the page while modal is presented) and the generic "Saved" message when things may not have been updated because there were no changes. However, overall it's pretty clever stuff, worthy of emulating.

ps In the future, please post your Joomla questions at JoomlaStackExchange .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM