Versioning the updates of dB Records

I am totally new to Yii and PHP frameworks in general. I love it because I don’t have to write the basic code. ;D

However, a current system that I have created I added a feature that will store a "version" of a dB record into a separate table "_versioning" that contains a version number of the update and what the record contained before a user updated the contents.

After some searching I could not find anything that would do this in Yii, maybe I’m just searching for the wrong term.

To explain further:


a) user adds FirstName, LastName, Address, etc stored in ADDRESS table

<img src='http://www.yiiframework.com/forum/public/style_emoticons/default/cool.gif' class='bbc_emoticon' alt='B)' /> user updates Address 

     i) store old info in "ADDRESS_versioning" table

    ii) save as version 1 [current table has v1] 

   iii) update "version number" before saving into current table as v2

c) new updates reside in ADDRESS table.

Is there something within the Yii framework to do this automatically?

Check this extension - http://www.yiiframework.com/extension/eactsasversioned

Thanks for the reply!

That is what I was looking for. I’m not really sure why I didn’t browse the extensions for this.

I noticed in your suggested example above, you were looking to add an _versioning table for each table in the db. The eactsasversioned extention versions all records inside of the same table rather than adding an additional table for versioning. With this approach the table can get huge very quickly and over the course of a couple of years the app could run into performance issues. Is there an extention or way to extend the eactsasversioned extention to work with separate tables for versioning? How are other people versioning their table records?

Very interesting point. As soon as I have time I will look into this issue!

Cheers