ALTER TABLE `mapOfTheDay` DROP INDEX `UniqueTypeDate` ,
ADD UNIQUE `UniqueTypeDate` ( `mapDate` , `mapType` );

ALTER TABLE `mapOfTheDay` ADD `championPointsWorth` INT NOT NULL DEFAULT '0';

ALTER TABLE `users` ADD `totalMazes` INT NOT NULL DEFAULT '0',
ADD `totalMoves` INT NOT NULL DEFAULT '0';

ALTER TABLE `solutions` ADD `isTiedForHighScore` BOOLEAN NOT NULL DEFAULT '0';

ALTER TABLE  `users` ADD  `challengeTier` INT NOT NULL ,
ADD  `championPoints` INT NOT NULL ,
ADD  `totalWins` INT DEFAULT  '0' NOT NULL ,
ADD  `totalTies` INT DEFAULT  '0' NOT NULL ;

ALTER TABLE  `solutions` ADD  `championPointsWorth` INT DEFAULT  '0' NOT NULL ,
ADD  `isHighScore` TINYINT( 1 ) NOT NULL ;

ALTER TABLE `solutions` ADD `isTiedForHighScore` BOOLEAN NOT NULL DEFAULT '0';

-- Add the 'mapExpireTime' column
ALTER TABLE `mapOfTheDay` ADD `mapExpireTime` DATETIME NULL DEFAULT NULL AFTER `mapDate`;

UPDATE mapOfTheDay
SET mapExpireTime = DATE_ADD(mapDate, INTERVAL 1 DAY)
WHERE mapType <> 5;

UPDATE mapOfTheDay
SET mapExpireTime = DATE_ADD(mapDate, INTERVAL 2 DAY)
WHERE mapType = 5;

ALTER TABLE `mapOfTheDay` CHANGE `mapExpireTime` `mapExpireTime` DATETIME NOT NULL;

ALTER TABLE `mapOfTheDay` ADD INDEX ( `mapExpireTime` , `mapType` );

-- The new code relies on these being unique, so we'll enforce that through indices.  Make sure you
-- verify these ARE unique in the DB before adding these indices (they weren't in my test DB)
-- Should probably run these two commands by themselves, one at a time
ALTER TABLE `maps` ADD UNIQUE ( `challengeTier` , `challengeSuborder`);

ALTER TABLE `challenges`
DROP INDEX `mapID` ,
ADD UNIQUE `mapID` ( `mapID` , `ordering` );