AR Relation with non primary key

Hello!

Im trying to connect two tables using AR relations and show the value in CGridview.




	clubgroupcontent.name



When I run the application, that column in the list is empty (I know there is data in the table).

The relation look like this


'clubgroupcontent' => array(self::BELONGS_TO, 'ClubGroupContent', 'swim_club_id')

"swim_club_id" is not the primary key in this table, and I think this is the problem since the same method is working in other table relations.

Is there a way around this? Or maybe it’s the “BELONGS_TO” that’s causing the problem?