handle 1945 all-star game not being played
This commit is contained in:
parent
fbd9e4b669
commit
d4729206da
|
@ -1,15 +1,14 @@
|
|||
begin;
|
||||
create table if not exists allstargames (
|
||||
"gameID" text,
|
||||
"yearID" numeric,
|
||||
"gameNum" numeric,
|
||||
primary key("gameID")
|
||||
"gameID" text,
|
||||
primary key("yearID","gameNum")
|
||||
);
|
||||
|
||||
insert into allstargames
|
||||
select distinct gameid, yearid, gamenum
|
||||
select distinct yearid, gamenum, gameid
|
||||
from allstarfull;
|
||||
|
||||
alter table allstarfull drop column "yearID";
|
||||
alter table allstarfull drop column "gameNum";
|
||||
alter table allstarfull drop column "gameID";
|
||||
commit;
|
||||
|
|
|
@ -11,4 +11,9 @@ where gameid = 'NLS196207300';
|
|||
-- david freese has two all-star entries for 2012, one in AL
|
||||
delete from allstarfull
|
||||
where playerid = 'freesda01' and yearid = 2012 and lgid = 'AL';
|
||||
|
||||
-- 1945 all-star game wasn't played so some rows have no game id
|
||||
update allstarfull
|
||||
set gameid = null
|
||||
where gameid = '';
|
||||
commit;
|
||||
|
|
|
@ -8,7 +8,7 @@ CREATE TABLE "pk_allstarfull" (
|
|||
"lgID" NUMERIC,
|
||||
"GP" NUMERIC,
|
||||
"startingPos" NUMERIC,
|
||||
primary key("playerID","gameID","startingPos"),
|
||||
primary key("playerID","yearID","gameNum","startingPos"),
|
||||
foreign key("playerID") references "people"("playerID")
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in New Issue