[feature request] Automatic Data Versioning in MariaDB Server

Hello,

While looking for record versioning, I stumbled upon below article from MariaDB which briefs about Automatic Data Versioning in MariaDB Server.

This is an incredible feature of MariaDB and if integrated into Frappe, it can enable some Master Data Management features in Frappe. It can allow seeing point-in-time values of a record (in addition to the diff provided in Version Log in frappe).

Another use case could be Audit Trail, especially where such a trail is a compliance requirement. As this is automatic versioning and provided by MariaDB:

  1. It would very difficult (if not impossible) to erase the trail of changes made to a document.
  2. It will work even for statements like frappe.db.set_value which skips most of the ORM code.

I couldn’t find a mention of this in discuss so just wanted to bring it to attention of Developers if it makes sense to incorporate into frappe.

One way of implementing it is:

  1. Allow a checkbox in DocType to allow Data Versioning
  2. For such docs, when a Version record is opened by clicking on version trail at bottom of document, the complete record as of that time can be displayed below the changes list. This allows observing the change in context of whole record
  3. For such doctypes where Audit Trail is a requirement, the corresponding table can be queried with FOR clause to provide

Thanks