Possible Duplicate:
Foreign Key not storing in Yii
I have a database like this
====Group=====
id
name
====Member====
id
group_id
firstname
lastname
membersince
Now I used this relations in models.
Group Model
public function relations()
{
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
return array(
'member' => array(self::HAS_MANY, 'Member', 'group_id'),
);
}
Member Model
public function relations()
{
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
return array(
'group' => array(self::BELONGS_TO, 'Group', 'group_id'),
);
}
So can some one tell me is this relation is right or am I missing something any help and suggestios will be highly appreciable.