Displaying 2 results from an estimated 2 matches for "home_team_scor".
Did you mean:
home_team_score
2006 Mar 07
13
Active Record - Can''t figure out relationship.
...varchar(50) not null,
logo varchar(20) not null,
primary key (id)
);
create table rounds (
id int not null auto_increment,
home_team_id int not null,
away_team_id int not null,
round tinyint(4) not null,
home_team_score tinyint(8) not null,
away_team_score tinyint(8) not null,
constraint fk_home_teams foreign key (home_team_id) references
teams(id),
constraint fk_away_teams foreign key (away_team_id) references
teams(id),
primary key (id)
);
And I need to be able to access this data through a join,...
2006 May 14
3
Strange Database Mapping Question
...levant tables in my database are as follows:
create table teams (
id INT AUTO_INCREMENT NOT NULL,
name VARCHAR(40),
PRIMARY_KEY(id) );
create table games (
id INT AUTO_INCREMENT NOT NULL,
date DATETIME, #Date of game
home_teams_id INT, #id of home team
away_teams_id INT, #id of away team
home_team_score INT, #this is not meant to link to another table
away_team_score INT, #this is not meant to link to another table
PRIMARY_KEY (id) );
In this example the home and away team records in games are supposed to link
to a team record in teams.
In the models, I was thinking that the game model would...