一旦问题相当广泛(可以有很多好的答案) – 这不是一个答案,而是另一个可能的解决方案:
你可以拥有如下表格:
id - just autogenerated number
datetime - date of change
changed_by - string with name of actor or id of some user
oldvalue - just old value
newvalue - just new value
update_insert_sql - here you put actual SQL which should be executed (you already have this sql in your current code)
state - 0 - it is not applied to db, 1 - already executed, 2 - you're rejected this change
datetime_of_apply - just date of action
datetime_of_reject - just date of action
注意:不存储旧值,您可以存储SQL以获取当前值,这将有助于您在从不同的主持人到同一行/列的几个更改时
因此,在您的界面中,您将可以看到所有表的所有提议的更改,只查看实际值和提出的新值,并在需要时更新db
可能的补充:要填充此表,您可以使用触发器,而不是更改当前代码