我需要设计一个历史表来跟踪编辑时在特定记录上更改的多个值.
Example:
The user is presented with a page to edit the record.
Title: Mr.
Name: Joe
Tele: 555-1234
DOB: 1900-10-10
如果用户更改了这些值中的任何一个,我需要跟踪旧值并记录新值.
我想用这样一张桌子:
History
---------------
id
modifiedUser
modifiedDate
tableName
recordId
oldValue
newValue
这样做的一个问题是,每次编辑都会有多个条目.
我还在考虑在历史表中保留一行的副本,但这似乎也没有效率.
有什么 idea 吗?
谢谢!