My database structure has several MANY_MANY links. However Gii (giix in my case) does not always generate them as MANY_MANY, instead it generates a HAS_MANY with the joint table.
Are there rules to make sure Gii does the correct relationship? Does it look at the name of the columns? Names of the tables? Indexes? Foreign key names? What if there are other columns in the joint table?
Gii actually checks every table to see if there are join tables (see
ModelCode::isRelationTable()in gii/generators/model). It detects a table as a join table if:Gii then creates a many-to-many relationship between the participating models.