What's the best way to store changes to database records that require approval before being visible?

前端 未结 8 1695
说谎
说谎 2020-12-07 13:44

I need to store user entered changes to a particular table, but not show those changes until they have been viewed and approved by an administrative user. While those chang

8条回答
  •  不思量自难忘°
    2020-12-07 14:20

    I would create a table with an flag and create a view like

     CREATE OR REPLACE VIEW AS 
    
      SELECT * FROM my_table where approved = 1
    

    It can help to separate dependencies between the aprovement and the queries. But may be is not the best idea if need to make updates to the view.

    Moving records might have some performance considerations. But Partitioned tables could do something quite similar.

提交回复
热议问题