[英]What is the best way to implement versioning to a MYSQL database?
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.
我的第一个想法是,当用户真的想编辑一篇文章时,我让 sql 不再更新,但您将他们的信息重新插入数据库。 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).
目前的问题是我有一个文章表,我使用 ID 作为我的主键来识别我的文章(所以阅读更多链接等等)。 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.
如果我插入到该表中,我将有基本的新文章,所以我想我需要一个新表来存放旧文章,但是我在第一个表 dbArticles 中遇到了原件的问题,我还需要为什么要告诉他们是哪篇文章已经选择了,例如,如果他们有 3 次编辑,那么 3 篇文章让所有在 5 月 1 日、2 日和 3 日的不同日子完成,我需要如何证明他们选择了 5 月 2 日的版本,而不是 5 月 3 日的最新版本。 Any help would be greatly receive thanks,
任何帮助都会非常感谢,
Cool Hand Luke Uk酷手卢克英国
Ps I am using PHP also and I am timestamping articles:D. Ps 我也在使用 PHP 并且我正在为文章添加时间戳:D。
Have 2 tables:有2张桌子:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.