Bir MYSQL veritabanına sürüm uygulamak için en iyi yolu nedir?

2 Cevap php

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 Ben de PHP kullanıyorum ve makaleleri Timestamping ediyorum: D.

2 Cevap

2 tablolar var:

  • makale: burada article_id, makale adı ve diğer herhangi bir meta veri depolamak
  • article_version: Burada her (orijinal dahil) maddenin sürümü ve article_version.article_id = article.article_id ile bağlantı saklayın. Bu tabloda bir zaman damgası ve sürümü vb eklemek için emin olun.

Eğer metinsel makalelerin sürüm sonra ise, örneğin MediaWiki, bir wiki kullanmayı düşünmelisiniz. Onlar sizin için sorunu çözmüş olabilir.