CREATE TABLE "players_info_tmp" (
	`id`	INTEGER NOT NULL,
	`player_id`	INTEGER,
	`game_id`	INTEGER,
	`civs`	VARCHAR(20),
	`teams`	INTEGER,
	`economyScore`	INTEGER,
	`militaryScore`	INTEGER,
	`totalScore`	INTEGER,
	`foodGathered`	INTEGER,
	`foodUsed`	INTEGER,
	`woodGathered`	INTEGER,
	`woodUsed`	INTEGER,
	`stoneGathered`	INTEGER,
	`stoneUsed`	INTEGER,
	`metalGathered`	INTEGER,
	`metalUsed`	INTEGER,
	`vegetarianFoodGathered`	INTEGER,
	`treasuresCollected`	INTEGER,
	`lootCollected`	INTEGER,
	`tributesSent`	INTEGER,
	`tributesReceived`	INTEGER,
	`totalUnitsTrained`	INTEGER,
	`totalUnitsLost`	INTEGER,
	`enemytotalUnitsKilled`	INTEGER,
	`infantryUnitsTrained`	INTEGER,
	`infantryUnitsLost`	INTEGER,
	`enemyInfantryUnitsKilled`	INTEGER,
	`workerUnitsTrained`	INTEGER,
	`workerUnitsLost`	INTEGER,
	`enemyWorkerUnitsKilled`	INTEGER,
	`femaleCitizenUnitsTrained`	INTEGER,
	`femaleCitizenUnitsLost`	INTEGER,
	`enemyFemaleCitizenUnitsKilled`	INTEGER,
	`cavalryUnitsTrained`	INTEGER,
	`cavalryUnitsLost`	INTEGER,
	`enemyCavalryUnitsKilled`	INTEGER,
	`championUnitsTrained`	INTEGER,
	`championUnitsLost`	INTEGER,
	`enemyChampionUnitsKilled`	INTEGER,
	`heroUnitsTrained`	INTEGER,
	`heroUnitsLost`	INTEGER,
	`enemyHeroUnitsKilled`	INTEGER,
	`shipUnitsTrained`	INTEGER,
	`shipUnitsLost`	INTEGER,
	`enemyShipUnitsKilled`	INTEGER,
	`traderUnitsTrained`	INTEGER,
	`traderUnitsLost`	INTEGER,
	`enemyTraderUnitsKilled`	INTEGER,
	`totalBuildingsConstructed`	INTEGER,
	`totalBuildingsLost`	INTEGER,
	`enemytotalBuildingsDestroyed`	INTEGER,
	`civCentreBuildingsConstructed`	INTEGER,
	`civCentreBuildingsLost`	INTEGER,
	`enemyCivCentreBuildingsDestroyed`	INTEGER,
	`houseBuildingsConstructed`	INTEGER,
	`houseBuildingsLost`	INTEGER,
	`enemyHouseBuildingsDestroyed`	INTEGER,
	`economicBuildingsConstructed`	INTEGER,
	`economicBuildingsLost`	INTEGER,
	`enemyEconomicBuildingsDestroyed`	INTEGER,
	`outpostBuildingsConstructed`	INTEGER,
	`outpostBuildingsLost`	INTEGER,
	`enemyOutpostBuildingsDestroyed`	INTEGER,
	`militaryBuildingsConstructed`	INTEGER,
	`militaryBuildingsLost`	INTEGER,
	`enemyMilitaryBuildingsDestroyed`	INTEGER,
	`fortressBuildingsConstructed`	INTEGER,
	`fortressBuildingsLost`	INTEGER,
	`enemyFortressBuildingsDestroyed`	INTEGER,
	`wonderBuildingsConstructed`	INTEGER,
	`wonderBuildingsLost`	INTEGER,
	`enemyWonderBuildingsDestroyed`	INTEGER,
	`woodBought`	INTEGER,
	`foodBought`	INTEGER,
	`stoneBought`	INTEGER,
	`metalBought`	INTEGER,
	`tradeIncome`	INTEGER,
	`percentMapExplored`	INTEGER,
	PRIMARY KEY(id),
	FOREIGN KEY(`player_id`) REFERENCES players ( id ),
	FOREIGN KEY(`game_id`) REFERENCES games ( id )
);
INSERT INTO players_info_tmp SELECT `id`,`player_id`,`game_id`,`civs`,`teams`,`economyScore`,`militaryScore`,`totalScore`,`foodGathered`,`foodUsed`,`woodGathered`,`woodUsed`,`stoneGathered`,`stoneUsed`,`metalGathered`,`metalUsed`,`vegetarianFoodGathered`,`treasuresCollected`,`lootCollected`,`tributesSent`,`tributesReceived`,`totalUnitsTrained`,`totalUnitsLost`,`enemytotalUnitsKilled`,`infantryUnitsTrained`,`infantryUnitsLost`,`enemyInfantryUnitsKilled`,`workerUnitsTrained`,`workerUnitsLost`,`enemyWorkerUnitsKilled`,`femaleUnitsTrained`,`femaleUnitsLost`,`enemyFemaleUnitsKilled`,`cavalryUnitsTrained`,`cavalryUnitsLost`,`enemyCavalryUnitsKilled`,`championUnitsTrained`,`championUnitsLost`,`enemyChampionUnitsKilled`,`heroUnitsTrained`,`heroUnitsLost`,`enemyHeroUnitsKilled`,`shipUnitsTrained`,`shipUnitsLost`,`enemyShipUnitsKilled`,`traderUnitsTrained`,`traderUnitsLost`,`enemyTraderUnitsKilled`,`totalBuildingsConstructed`,`totalBuildingsLost`,`enemytotalBuildingsDestroyed`,`civCentreBuildingsConstructed`,`civCentreBuildingsLost`,`enemyCivCentreBuildingsDestroyed`,`houseBuildingsConstructed`,`houseBuildingsLost`,`enemyHouseBuildingsDestroyed`,`economicBuildingsConstructed`,`economicBuildingsLost`,`enemyEconomicBuildingsDestroyed`,`outpostBuildingsConstructed`,`outpostBuildingsLost`,`enemyOutpostBuildingsDestroyed`,`militaryBuildingsConstructed`,`militaryBuildingsLost`,`enemyMilitaryBuildingsDestroyed`,`fortressBuildingsConstructed`,`fortressBuildingsLost`,`enemyFortressBuildingsDestroyed`,`wonderBuildingsConstructed`,`wonderBuildingsLost`,`enemyWonderBuildingsDestroyed`,`woodBought`,`foodBought`,`stoneBought`,`metalBought`,`tradeIncome`,`percentMapExplored` FROM `players_info`;
DROP TABLE `players_info`;
ALTER TABLE `players_info_tmp` RENAME TO `players_info`;