Adding Model/CRUD Attributes

If I’ve already created a DB schema and used Gii to generate a model and CRUD interface, is it easy to re-generate the code to include new attributes (added later)? Basically, if I go into my database and add a column for “category” and now want this to be included in my model/views without having to manually add it in the code, can Gii do this? Is it simply a matter of regenerating the files?


See relevant thread here

yes, as simple as that. Just enter your table name then click Preview, Gii will display a list of file like usual. If there are same file name then Gii will give flag with red background and checkbox whether you want to overwrite the file or not. You can also see the difference before execute it by clicking the diff link.