doucao1888 2009-03-06 11:17
浏览 411
已采纳

对MYSQL数据库实施版本控制的最佳方法是什么?

I have to produce a versioning system to store multiple versions of my articles in a database to allow the user to roll-back if required. My first thoughts are when the user wants to edit an article really I get the sql to no longer update but you insert their information back into the database. Currently the problem is i have an articles table and I am using the ID as my primary key to identify my article (so read more links and so on). If i insert into that table I will have basicly new articles, so I am thinking I need a new table for the older articles but then I have problem of the originals in that first table dbArticles, I also need so why of telling which article they have choosen, for example if they have 3 edits so 3 articles lets all made on seperate days may 1st,2nd and 3rd how I need to show they have choosen the 2nd of May version rather than the latest on the 3rd of May. Any help would be greatly receive thanks,

Cool Hand Luke Uk

Ps I am using PHP also and I am timestamping articles :D.

  • 写回答

2条回答 默认 最新

  • dps123456789 2009-03-06 11:23
    关注

    Have 2 tables:

    • article: here you store article_id, article name and any other meta data
    • article_version: Here you store each version of the article (including the original one) and link with article_version.article_id=article.article_id. Be sure to add a timestamp and version etc in this table.
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 求一个html代码,有偿
  • ¥100 关于使用MATLAB中copularnd函数的问题
  • ¥20 在虚拟机的pycharm上
  • ¥15 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波
  • ¥15 针对曲面部件的制孔路径规划,大家有什么思路吗
  • ¥15 钢筋实图交点识别,机器视觉代码
  • ¥15 如何在Linux系统中,但是在window系统上idea里面可以正常运行?(相关搜索:jar包)
  • ¥50 400g qsfp 光模块iphy方案
  • ¥15 两块ADC0804用proteus仿真时,出现异常