Database history for client usage

后端 未结 4 1273
心在旅途
心在旅途 2021-01-16 16:22

I\'m trying to figure out what would be the best way to have a history on a database, to track any Insert/Delete/Update that is done. The history data will need to be coded

4条回答
  •  佛祖请我去吃肉
    2021-01-16 16:53

    I have used very successfully a model where every table has an audit copy - the same table with a few additional fields (time stamp, user id, operation type), and 3 triggers on the first table for insert/update/delete.
    I think this is a very good way of handling this, because tables and triggers can be generated from a model and there is little overhead from a management perspective. The application can use the tables to show an audit history to the user (read-only).

提交回复
热议问题