From 2b852b97cb6e6d0270c5f3ffbfb28a8279e37f90 Mon Sep 17 00:00:00 2001
From: BlueRaja <BlueRaja.admin@gmail.com>
Date: Tue, 12 Mar 2013 19:59:12 -0500
Subject: Updating db updates.sql for production data

---
 db updates.sql | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

(limited to 'db updates.sql')

diff --git a/db updates.sql b/db updates.sql
index 2e04942..1f275db 100644
--- a/db updates.sql	
+++ b/db updates.sql	
@@ -1,8 +1,10 @@
 -- Remove 'on update CURRENT_TIMESTAMP' from dateLogin
-ALTER TABLE  `users` CHANGE  `dateLogin`  `dateLogin` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
+ALTER TABLE  `users` CHANGE  `dateLogin`  `dateLogin` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
 
-ALTER TABLE `mapOfTheDay` DROP INDEX `UniqueTypeDate` ,
-ADD UNIQUE `UniqueTypeDate` ( `mapDate` , `mapType` );
+ALTER TABLE `mapOfTheDay` DROP INDEX `UniqueTypeDate`;
+DELETE FROM mapOfTheDay WHERE ID IN (2224, 2334, 2443, 2469, 2328);
+DELETE FROM solutions WHERE ID = 29157;
+CREATE UNIQUE INDEX `UniqueTypeDate` ON `mapOfTheDay` ( `mapDate` , `mapType` );
 
 ALTER TABLE `mapOfTheDay` ADD `championPointsWorth` INT NOT NULL DEFAULT '0';
 
@@ -19,8 +21,6 @@ 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`;
 
@@ -36,15 +36,6 @@ ALTER TABLE `mapOfTheDay` CHANGE `mapExpireTime` `mapExpireTime` DATETIME NOT NU
 
 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 `challengeMaps` ADD UNIQUE ( `challengeTier` , `challengeSuborder`);
-
-ALTER TABLE `challenges`
-DROP INDEX `mapID` ,
-ADD UNIQUE `mapID` ( `mapID` , `ordering` );
-
 -- Move shit from userData table to users
 ALTER TABLE `users` ADD `displayColor` VARCHAR( 7 ) NOT NULL DEFAULT '#cccccc' ,
 ADD `wallColor` VARCHAR( 7 ) NOT NULL DEFAULT '#666666' ,
@@ -108,4 +99,13 @@ AND (maps.name IS NULL OR maps.name = '');
 ALTER TABLE `solutions` CHANGE `solution` `solution` VARCHAR( 4095 ) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL;
 
 -- Fix Typo
-UPDATE unlocks SET name = 'Light Diagonal Cover' WHERE name = 'Light Diagnol Cover'
\ No newline at end of file
+UPDATE unlocks SET name = 'Light Diagonal Cover' WHERE name = 'Light Diagnol Cover';
+
+-- 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 `challengeMaps` ADD UNIQUE ( `challengeTier` , `challengeSuborder`);
+
+ALTER TABLE `challenges`
+DROP INDEX `mapID` ,
+ADD UNIQUE `mapID` ( `mapID` , `ordering` );
\ No newline at end of file
-- 
cgit v1.2.3

