I am developing log module (currently only for ActiveRecord, but custom messages are also planned).
I came up with following DB tables structure:
As you can see, log models and attributes and their changes are stored separately.
log_list_attributes_changes is for many-to-many relationship (to avoid just imploding this as string, and be able to extract it and format as needed).
Before that the logger I used stored everything in one table. And in the extensions I saw similar approach is used.
However there are some problems with this approach. It makes search harder, readability of such logs is also not good, plus problems with refactoring namespaces of models and their attributes names exist.
Therefore I deceded to try reorganize it.
But isn’t that overkill for such structure?
It will be good to see some advices and recommendations.
P.S. For adding and removing constraints there are overrided methods used, don’t bother about that.
So the current question is how good this structure is in terms of organization and perfomance? As for advantages, I mentioned some above plus there are better links between models.
Maybe someone want to help in contributing? Or at least advise what else can be useful from such module user point of view?