Updating Active Records?

Let say I have a table that is mapped to an active record model. I add in a bunch of custom logic to the model and now I have added 15 new fields to the table. Is there a way for me to regenerate the model to proper configure those 15 new fields without erasing my custom logic I have built?

In the framework I was building, when I did model code generation I generated 2 files, a base file and then a model file for each model. After that when I regenerated the models, I would only update the base one which stored all the field configuration stuff. That way the user could add all the custom logic in the model file that extends the base one and not worry about regenerating the model code when the table changes. Does something like this exist with Yii?

Usually you don’t have to adjust your models when you add new db fields - except rules() maybe. The rules that get autogenerated from the yiic “model” command are only for quickstart anyway. In most cases they’ll need some manual tuning. So: No command to update the models but it shouldn’t be a big deal to do so manually.