Row versioning in MySQL

前端 未结 2 1046
-上瘾入骨i
-上瘾入骨i 2021-01-03 14:10

I would like to include an integer version field in my table, auto-incrementing on each update made to a row. Is it possible to do this in MySQL?

Please note that I\

2条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-03 14:40

    The only way (I can think of) to do this is a (before-update) trigger that automatically increments the column value.

提交回复
热议问题