From cceb5da4cc747e63f7adf0b4bd01bf8792ad1356 Mon Sep 17 00:00:00 2001
From: Patrick Davison <snapwilliam@gmail.com>
Date: Tue, 12 Mar 2013 18:10:38 -0700
Subject: tables and maps.name for db.updates.sql

---
 db updates.sql | 128 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 127 insertions(+), 1 deletion(-)

(limited to 'db updates.sql')

diff --git a/db updates.sql b/db updates.sql
index 7e7bc8b..d97095c 100644
--- a/db updates.sql	
+++ b/db updates.sql	
@@ -52,7 +52,11 @@ DROP TABLE `userData`;
 ALTER TABLE `users` ADD `dateChatGaggedUntil` DATETIME NULL ,
 ADD `isOptedOutOfEmails` BOOLEAN NOT NULL DEFAULT '0';
 
+
 -- Most special maps (and some others) have the map-name in the map code.  Copy it to the name column.
+-- Add column:
+ALTER TABLE  `maps` ADD  `name` VARCHAR( 100 ) NULL DEFAULT NULL AFTER  `code`
+--Insert values
 UPDATE maps
 INNER JOIN
 (
@@ -115,4 +119,126 @@ ALTER TABLE `challengeMaps` ADD UNIQUE ( `challengeTier` , `challengeSuborder`);
 
 ALTER TABLE `challenges`
 DROP INDEX `mapID` ,
-ADD UNIQUE `mapID` ( `mapID` , `ordering` );
\ No newline at end of file
+ADD UNIQUE `mapID` ( `mapID` , `ordering` );
+
+
+
+-- TABLES:
+-- 
+-- Table structure for table `challengeMaps`
+-- 
+
+CREATE TABLE `challengeMaps` (
+  `ID` int(11) NOT NULL AUTO_INCREMENT,
+  `code` varchar(512) COLLATE latin1_general_ci NOT NULL,
+  `name` varchar(100) COLLATE latin1_general_ci NOT NULL,
+  `challengeTier` int(11) NOT NULL,
+  `challengeSuborder` int(11) NOT NULL,
+  PRIMARY KEY (`ID`),
+  KEY `challengeTier` (`challengeTier`,`challengeSuborder`)
+) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=3 ;
+
+-- 
+-- Table structure for table `challengeSolutions`
+-- 
+
+CREATE TABLE `challengeSolutions` (
+  `ID` int(11) NOT NULL AUTO_INCREMENT,
+  `userID` int(11) NOT NULL,
+  `challengeID` int(11) NOT NULL,
+  `solution` varchar(512) COLLATE latin1_general_ci NOT NULL,
+  `moves` int(11) NOT NULL,
+  `dateSolved` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+  PRIMARY KEY (`ID`),
+  UNIQUE KEY `userID_challengeID` (`userID`,`challengeID`)
+) ENGINE=MyISAM AUTO_INCREMENT=110 DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=110 ;
+
+-- --------------------------------------------------------
+
+-- 
+-- Table structure for table `challenges`
+-- 
+
+CREATE TABLE `challenges` (
+  `ID` int(11) NOT NULL AUTO_INCREMENT,
+  `mapID` int(11) NOT NULL,
+  `inequality` enum('greater than','less than','equal') COLLATE latin1_general_ci NOT NULL DEFAULT 'greater than' COMMENT 'Whether we want to get more than, less than, or equal to the goal.',
+  `goal` int(11) NOT NULL COMMENT 'The amount we want to get for this map',
+  `ordering` int(11) NOT NULL COMMENT 'Used to order challenges on the challenge page.  Lower values come first',
+  `enabled` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'Only enabled challenges will be displayed',
+  `hint` varchar(512) COLLATE latin1_general_ci DEFAULT NULL COMMENT 'Hint to be given to the player (for the intro puzzles - if hint is null, it won''t be shown)',
+  `restrictWallCount` int(11) DEFAULT NULL COMMENT 'Restriction on the (max) number of walls that can be used',
+  `restrictWallPlacement` varchar(100) COLLATE latin1_general_ci DEFAULT NULL COMMENT 'Restriction that disallows certain places for walls',
+  `restrictTeleportCount` int(11) DEFAULT NULL COMMENT 'Restriction on the number of teleports used',
+  `restrictTeleportsUsed` varchar(100) COLLATE latin1_general_ci DEFAULT NULL COMMENT 'Restriction disallowing the use of certain teleports',
+  `restrictStartPoint` varchar(100) COLLATE latin1_general_ci DEFAULT NULL COMMENT 'Restriction that the maze must start at the given start-point',
+  `restrictEndPoint` varchar(100) COLLATE latin1_general_ci DEFAULT NULL COMMENT 'Restriction that the maze must end at the given end point',
+  PRIMARY KEY (`ID`),
+  KEY `mapID` (`mapID`,`enabled`)
+) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=6 ;
+
+-- --------------------------------------------------------
+
+-- 
+-- Table structure for table `chat`
+-- 
+
+CREATE TABLE `chat` (
+  `ID` int(11) NOT NULL AUTO_INCREMENT,
+  `userID` int(11) NOT NULL,
+  `message` varchar(511) COLLATE latin1_general_ci NOT NULL,
+  `dateSent` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+  PRIMARY KEY (`ID`)
+) ENGINE=MyISAM AUTO_INCREMENT=8829 DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=8829 ;
+
+-- --------------------------------------------------------
+
+-- 
+-- Table structure for table `emailQueue`
+-- 
+
+CREATE TABLE `emailQueue` (
+  `ID` int(11) NOT NULL AUTO_INCREMENT,
+  `emailID` int(11) NOT NULL,
+  `priority` tinyint(4) NOT NULL DEFAULT '100',
+  PRIMARY KEY (`ID`),
+  KEY `emailID` (`emailID`,`priority`)
+) ENGINE=MyISAM AUTO_INCREMENT=233 DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=233 ;
+
+-- --------------------------------------------------------
+
+-- 
+-- Table structure for table `emails`
+-- 
+
+CREATE TABLE `emails` (
+  `ID` int(11) NOT NULL AUTO_INCREMENT,
+  `fromUserID` int(11) NOT NULL,
+  `to` varchar(512) COLLATE latin1_general_ci NOT NULL,
+  `subject` varchar(512) COLLATE latin1_general_ci NOT NULL,
+  `body` mediumtext COLLATE latin1_general_ci NOT NULL,
+  `dateSubmited` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+  `dateSent` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
+  `error` varchar(512) COLLATE latin1_general_ci DEFAULT NULL,
+  PRIMARY KEY (`ID`)
+) ENGINE=MyISAM AUTO_INCREMENT=233 DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci PACK_KEYS=1 COMMENT='Queued emails' AUTO_INCREMENT=233 ;
+
+-- --------------------------------------------------------
+
+-- 
+-- Table structure for table `settings`
+-- 
+
+CREATE TABLE `settings` (
+  `name` varchar(16) COLLATE latin1_general_ci NOT NULL,
+  `value` varchar(128) COLLATE latin1_general_ci NOT NULL,
+  PRIMARY KEY (`name`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
+
+-- 
+-- Dumping data for table `settings`
+-- 
+
+INSERT INTO `settings` VALUES ('Email_Last_Sent', '1362982189');
+
+
-- 
cgit v1.2.3

