pragma foreign_keys = 0;

begin;
attach database 'baseball-raw.db' as 'raw';

create temp table parks as
select * from "raw".parks;

alter table parks drop column "ID";
alter table parks drop column "parkalias";

CREATE TABLE IF NOT EXISTS main."parks" (
	"ID"	TEXT,
	"name"	TEXT,
	"city"	TEXT,
	"state"	TEXT,
	"country"	TEXT,
	PRIMARY KEY("ID")
);

insert into main.parks select distinct "parkkey", "parkname", "city", "state", "country" from temp."parks";
commit;
