I\'m new to Yii here. In the documentation, it seems to imply that gii will create the relations for related models. But when using gii to generate models from DB, it doesn\
Gii will create relations for MyISAM tables if you include a format like the following in the comment of the referenced columns:
CONSTRAINT FOREIGN KEY (name_of_this_field) REFERENCES related_table_name(related_field_name)
Gii can automatically create relations for generated models if corresponding tables in your DB have foreign keys, but not all storage engines support foreign keys. For example, if you use MyISAM tables in MySQL, you have no way to define it.