Soccer League Model

Hi,

I have 2 tables in a database:

Player:




-id

-first_name

-last_name

-team_id  //references Team.id

Team:


-id

-name

-captain_id  //references Player.id

I have created the following relations:

in Player model:


'team' => array(self:BELONGS_TO, 'Team', 'team_id');

in Team model:




'players' => array(self::HAS_MANY, 'Player', 'team_id'),

'captain' => array(self::BELONGS_TO, 'Player', 'captain_id'),

Could someone more experienced look at it and tell me if this is the correct configuration please?

Thank you.

That looks fine to me.