I'm about to start developing a cms in actionscript 3 (in order to learn the language), one of the features that I'd like to learn more about prior to starting my personal project is design patterns for versioning (i.e. cvs,subversion, etc.)
I'm not so interested in the actual code, more the algorithm's and best practices.
I've created one in the past in php that stores the intended query to be executed and a viewable version of changes into an 'approval' table (using mysql), if this gets approved then the query is fired (such as insert/update/delete), but it felt a bit messy - someone could come along between one person's changes, edit and submit an old version with their changes.
I'm looking for really simple ideas, nothing as complex as subversion,etc. All data will be stored in a db (again, not code-specific), and I'd need to be able to roll back, store drafts, etc.
I realise this can be a bit of a dry subject, but really would appreciate feedback :)
To be honest I think storing queries inside a table is never a good idea.
The problem is scaleabilty. Once you have all these 'too be updated' records stored, what happens in the future if you need to use somthing such as mysql_insert_id(), add another column or like you suggest some one could submit an old version.
What you could try is using a temporary table which has identical columns to your main table. Once you approve the article or what ever. You can issue a query that copies the row to your main table.
Sounds like an interesting idea that your on here.