How To Solve Yii Application Modifications Previously Created From Command Yiic?

I have heard that the changes in a Yii application that was created from yiic, it presents some difficulties if we want to realize any change in the database and keep the model intact, in the event that go back to use yiic.

According to this, I would like to know whether exists some methods to solve this maintance trouble, using again yiic command. Or otherwise, the maintance is limited to modify directly code.

Note: trouble is refered to the situation that used again yiic command overwrite the previous model with all the changes.

Thank in advance :)

The giix extension provides a nice solution to this. It generates two model, one with ‘Base’ prefix that is filled with generated methods and a second one that extends the base model. If you need to make changes, you put them in the second one overriding anything generated in the base model.

This way if you need to regenerate the model you only overwrite the base model and keep all your changes intact in the second one. Sometimes you just need to browse your modifications and adjust them, but that is a lot easier using two models.

Yiic/gii create lot of boilerplate stuff, you can simply change them If you have already created models and your schema changes just run it one more time it will override the old files. you can copy the methods you have added yourself and paste them in your new models.


Thanks by your reply.

I was reading and I am going to give an opportunity, let´s see how behave.

Note: the "command code generator" seems the same of yiic. Do you know if there are the same instructions?