fix foreign key violations cascading from fixing team ids
This commit is contained in:
parent
f2f6f04a39
commit
00f197d89f
|
@ -1,3 +1,11 @@
|
||||||
begin;
|
begin;
|
||||||
alter table "appearances" drop column "lgID";
|
alter table "appearances" drop column "lgID";
|
||||||
|
|
||||||
|
update appearances
|
||||||
|
set teamid = 'WS9'
|
||||||
|
where teamid = 'WAS' and yearid between 1891 and 1899;
|
||||||
|
|
||||||
|
update appearances
|
||||||
|
set teamid = 'PHP'
|
||||||
|
where teamid = 'PH4' and yearid between 1890 and 1891;
|
||||||
commit;
|
commit;
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
begin;
|
begin;
|
||||||
alter table batting drop column "lgID";
|
alter table batting drop column "lgID";
|
||||||
|
|
||||||
|
update batting
|
||||||
|
set teamid = 'WS9'
|
||||||
|
where teamid = 'WAS' and yearid between 1891 and 1899;
|
||||||
|
|
||||||
|
update batting
|
||||||
|
set teamid = 'PHP'
|
||||||
|
where teamid = 'PH4' and yearid between 1890 and 1891;
|
||||||
commit;
|
commit;
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
begin;
|
begin;
|
||||||
alter table fielding drop column "lgID";
|
alter table fielding drop column "lgID";
|
||||||
|
|
||||||
|
update fielding
|
||||||
|
set teamid = 'WS9'
|
||||||
|
where teamid = 'WAS' and yearid between 1891 and 1899;
|
||||||
|
|
||||||
|
update fielding
|
||||||
|
set teamid = 'PHP'
|
||||||
|
where teamid = 'PH4' and yearid between 1890 and 1891;
|
||||||
commit;
|
commit;
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
begin;
|
begin;
|
||||||
alter table "homegames" drop column "league.key";
|
alter table "homegames" drop column "league.key";
|
||||||
|
|
||||||
|
update homegames
|
||||||
|
set "team.key" = 'WS9'
|
||||||
|
where "team.key" = 'WAS' and "year.key" between 1891 and 1899;
|
||||||
|
|
||||||
|
update homegames
|
||||||
|
set "team.key" = 'PHP'
|
||||||
|
where "team.key" = 'PH4' and "year.key" between 1890 and 1891;
|
||||||
commit;
|
commit;
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
begin;
|
begin;
|
||||||
alter table pitching drop column "lgID";
|
alter table pitching drop column "lgID";
|
||||||
|
|
||||||
|
update pitching
|
||||||
|
set teamid = 'WS9'
|
||||||
|
where teamid = 'WAS' and yearid between 1891 and 1899;
|
||||||
|
|
||||||
|
update pitching
|
||||||
|
set teamid = 'PHP'
|
||||||
|
where teamid = 'PH4' and yearid between 1890 and 1891;
|
||||||
commit;
|
commit;
|
||||||
|
|
Loading…
Reference in New Issue