CREATE TABLE `leaderboard` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `siteID` varchar(255) NOT NULL DEFAULT '',
  `gameID` varchar(255) NOT NULL DEFAULT '',
  `playerID` varchar(255) NOT NULL DEFAULT '',
  `name` varchar(255) NOT NULL DEFAULT '',
  `email` varchar(255) NOT NULL DEFAULT '',
  `pictureURL` varchar(255) NOT NULL DEFAULT '',
  `facebookUserID` varchar(255) NOT NULL DEFAULT '',
  `twitterUserID` varchar(255) NOT NULL DEFAULT '',
  `googleUserID` varchar(255) NOT NULL DEFAULT '',
  `result0` int(11) NOT NULL DEFAULT '0',
  `result1` int(11) NOT NULL DEFAULT '0',
  `result2` int(11) NOT NULL DEFAULT '0',
  `stars` int(11) NOT NULL DEFAULT '0',
  `duration` int(11) NOT NULL DEFAULT '0',
  `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `isAllTime` tinyint(1) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `siteID` (`siteID`,`gameID`),
  KEY `playerID` (`playerID`,`name`,`email`),
  KEY `facebookUserID` (`facebookUserID`,`twitterUserID`,`googleUserID`),
  KEY `date` (`date`),
  KEY `isAllTime` (`isAllTime`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;

CREATE TABLE `categories` (
  `gameID` varchar(255) NOT NULL DEFAULT '',
  `categoryID` varchar(255) NOT NULL DEFAULT '',
  KEY `gameID` (`gameID`),
  KEY `categoryID` (`categoryID`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;

CREATE TABLE `coinsPowerUpsLog` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `key` varchar(255) NOT NULL,
  `siteID` varchar(255) NOT NULL DEFAULT '',
  `playerID` varchar(255) NOT NULL DEFAULT '',
  `name` varchar(255) NOT NULL DEFAULT '',
  `email` varchar(255) NOT NULL DEFAULT '',
  `pictureURL` varchar(255) NOT NULL,
  `facebookUserID` varchar(255) NOT NULL DEFAULT '',
  `twitterUserID` varchar(255) NOT NULL,
  `googleUserID` varchar(255) NOT NULL,
  `coinsChange` int(11) NOT NULL,
  `coinsBalance` int(11) NOT NULL,
  `powerUpsChange` varchar(255) NOT NULL,
  `powerUpsBalance` varchar(255) NOT NULL,
  `source` varchar(255) NOT NULL,
  `gameID` varchar(255) NOT NULL DEFAULT '',
  `notes` varchar(255) NOT NULL,
  `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`id`),
  UNIQUE KEY `key_2` (`key`),
  KEY `key` (`key`),
  KEY `siteID` (`siteID`),
  KEY `playerID` (`playerID`,`name`,`email`),
  KEY `facebookUserID` (`facebookUserID`,`twitterUserID`,`googleUserID`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;