From ad5a964fa9b5a8c68f20482a88846edb6499355b Mon Sep 17 00:00:00 2001 From: Jason Cleeland Date: Mon, 20 Sep 2004 04:04:00 +0000 Subject: [PATCH] Activation now makes the "id" field of the survey responses table a unique index (important for importing results) git-svn-id: file:///Users/Shitiz/Downloads/lssvn/trunk/unstable@1202 b72ed6b6-b9f8-46b5-92b4-906544132732 --- admin/activate.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/admin/activate.php b/admin/activate.php index 913f8309c24..5a07f9cf8d1 100644 --- a/admin/activate.php +++ b/admin/activate.php @@ -171,6 +171,7 @@ { $fieldlist[]=$fielddata['fieldname']; } + $fieldlist=array_reverse($fieldlist); //let's always change the later duplicate, not the earlier one $checkKeysUniqueComparison = create_function('$value','if ($value > 1) return true;'); $duplicates = array_keys (array_filter (array_count_values($fieldlist), $checkKeysUniqueComparison)); foreach ($duplicates as $dup) @@ -354,7 +355,7 @@ if ( substr($createsurvey, strlen($createsurvey)-2, 2) != ",\n") {$createsurvey .= ",\n";} } //$createsurvey = substr($createsurvey, 0, strlen($createsurvey)-2); - $createsurvey .= " INDEX(id)\n"; + $createsurvey .= " UNIQUE(id)\n"; $createsurvey .= ") TYPE=MyISAM;"; //echo "
$createsurvey
\n"; //Debugging info