mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 20:30:39 +02:00
Add index on user_loginname
This commit is contained in:
@@ -11,8 +11,8 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_admin/sql/core_sql.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_admin/sql/core_sql.php,v $
|
||||||
| $Revision: 1.11 $
|
| $Revision: 1.12 $
|
||||||
| $Date: 2008-06-13 20:20:20 $
|
| $Date: 2008-11-02 14:54:38 $
|
||||||
| $Author: e107steved $
|
| $Author: e107steved $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
@@ -522,6 +522,7 @@ CREATE TABLE user (
|
|||||||
user_xup varchar(100) NOT NULL default '',
|
user_xup varchar(100) NOT NULL default '',
|
||||||
PRIMARY KEY (user_id),
|
PRIMARY KEY (user_id),
|
||||||
UNIQUE KEY user_name (user_name),
|
UNIQUE KEY user_name (user_name),
|
||||||
|
UNIQUE KEY user_loginname (user_loginname),
|
||||||
KEY join_ban_index (user_join,user_ban)
|
KEY join_ban_index (user_join,user_ban)
|
||||||
) TYPE=MyISAM;
|
) TYPE=MyISAM;
|
||||||
# --------------------------------------------------------
|
# --------------------------------------------------------
|
||||||
|
@@ -11,8 +11,8 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_handlers/db_table_admin_class.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_handlers/db_table_admin_class.php,v $
|
||||||
| $Revision: 1.5 $
|
| $Revision: 1.6 $
|
||||||
| $Date: 2008-08-12 20:26:43 $
|
| $Date: 2008-11-02 14:54:44 $
|
||||||
| $Author: e107steved $
|
| $Author: e107steved $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
@@ -237,6 +237,7 @@ class db_table_admin
|
|||||||
}
|
}
|
||||||
elseif ($list1[$i]['type'] == $list2[0]['type'])
|
elseif ($list1[$i]['type'] == $list2[0]['type'])
|
||||||
{ // Worth doing a compare - fields are same type
|
{ // Worth doing a compare - fields are same type
|
||||||
|
// echo $i.': compare - '.$list1[$i]['name'].', '.$list2[0]['name'].'<br />';
|
||||||
if (strcasecmp($list1[$i]['name'],$list2[0]['name']) != 0)
|
if (strcasecmp($list1[$i]['name'],$list2[0]['name']) != 0)
|
||||||
{ // Names differ, so need to add or subtract a field.
|
{ // Names differ, so need to add or subtract a field.
|
||||||
// echo $i.': names differ - '.$list1[$i]['name'].', '.$list2[0]['name'].'<br />';
|
// echo $i.': names differ - '.$list1[$i]['name'].', '.$list2[0]['name'].'<br />';
|
||||||
@@ -336,13 +337,20 @@ class db_table_admin
|
|||||||
{
|
{
|
||||||
case 'key' :
|
case 'key' :
|
||||||
case 'ukey' :
|
case 'ukey' :
|
||||||
case 'pkey' : // Require a key - got a field
|
case 'pkey' : // Require a key - got a field, or a key of a different type
|
||||||
while ((count($list2)>0) && ($list2[0]['type'] == 'field'))
|
while ((count($list2)>0) && ($list2[0]['type'] == 'field'))
|
||||||
{
|
{
|
||||||
$error_list[] = 'Extra field: '.$list2[0]['name'];
|
$error_list[] = 'Extra field: '.$list2[0]['name'];
|
||||||
$change_list[] = 'DROP '.$list2[0]['name'];
|
$change_list[] = 'DROP '.$list2[0]['name'];
|
||||||
array_shift($list2);
|
array_shift($list2);
|
||||||
}
|
}
|
||||||
|
if ((count($list2) == 0) || ($list1[$i]['type'] != $list2[0]['type']))
|
||||||
|
{ // need to add a key
|
||||||
|
$change_list[] = 'ADD '.$this->make_def($list1[$i]);
|
||||||
|
$error_list[] = 'Missing index: '.$list1[$i]['name'];
|
||||||
|
$created_list[$j] = $list1[$i]['name'];
|
||||||
|
$j++;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'field' : // Require a field - got a key. so add a field at the end
|
case 'field' : // Require a field - got a key. so add a field at the end
|
||||||
|
Reference in New Issue
Block a user