The VersionedActiveRecord Yii model class adds up functionality of saving each new version of a model into the database using just inserts.