I really enjoyed to dig into the solution I described yesterday in this post, to generate table audit information using invisible columns and triggers.
In this post, I will focus only on the solution using a JSON column to store the audit information.
Yesterday, I wrote that it’s also possible to track all changes an not only the last one but also keep information about what changed.
I wanted to illustrate that with an example, let’s start with the output:
This is exactly what I was looking for !
And of course we can search in that audit information. For example let’s search for all records that have been modified and where the old or new name was/is frederic:
We can verify that indeed that record had frederic as initial value.
Triggers
Compare …
[Read more]