summaryrefslogtreecommitdiffstats
path: root/db updates.sql
diff options
context:
space:
mode:
authorPatrick Davison <snapwilliam@gmail.com>2013-03-10 22:41:14 -0700
committerPatrick Davison <snapwilliam@gmail.com>2013-03-10 22:41:14 -0700
commit805a8fc305b140bc47e95a6ce4e01de0315bfe8c (patch)
tree9d2c81661c64aa62539eb3a17f5b6748ba2614a1 /db updates.sql
parent5f1f9c14ff60b8ae26edbd6a819c5d159da0026d (diff)
downloadpathery-805a8fc305b140bc47e95a6ce4e01de0315bfe8c.tar.xz
Duplicate Solution issue. Amazed this came up just now! O_o!
Diffstat (limited to 'db updates.sql')
-rw-r--r--db updates.sql8
1 files changed, 7 insertions, 1 deletions
diff --git a/db updates.sql b/db updates.sql
index 2e04942..66da097 100644
--- a/db updates.sql
+++ b/db updates.sql
@@ -108,4 +108,10 @@ 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'
+
+-- Change index to a unique index
+-- If any duplicates exist you can find them with this:
+-- select mapID, count(*) from `solutions` group by mapID, userID HAVING count(*) > 1
+ALTER TABLE `solutions` DROP INDEX `userID` ,
+ADD UNIQUE `userIDmapID` ( `userID` , `mapID` )