I have few tables in which there could be an update on some of the fields.
I would like to keep a history of changes of different fields. Different fields however have different types, however I wouldn't want to create many different columns in my "auditing" table.
So I though should I use serialization (I used it often in PHP), I'm not sure however how efficient it would be in Java/MySQL (I'm not using any data frameworks etc). If serialization, then to what? XML/JSON?
I thought two tables:
- AuditEntityProperty (Id (PK), EntityId (FK), PropertyName, From, To, DateTime, Username)
- AuditEntity (EntityId (PK), EntityName)
From/To are my current problems that I'm not sure how to address. I'm leaning towards XML and using TEXT as datatype for both. Ideas?