diff --git a/db/core.php b/db/core.php index 0ea0bc7614..f3461243fa 100644 --- a/db/core.php +++ b/db/core.php @@ -119,7 +119,7 @@ $schema['user'] = array( ), 'primary key' => array('id'), 'unique keys' => array( - 'user_name_idx' => array('name'), + 'user_nickname_idx' => array('nickname'), 'user_email_idx' => array('email'), 'user_incomingemail_idx' => array('incomingemail'), 'user_sms_idx' => array('sms'), diff --git a/lib/schema.php b/lib/schema.php index acc9412841..f6543a21b1 100644 --- a/lib/schema.php +++ b/lib/schema.php @@ -254,7 +254,16 @@ class Schema function buildIndexList(array $def) { // @fixme - return '(' . implode(',', array_map(array($this, 'quoteIdentifier'), $def)) . ')'; + return '(' . implode(',', array_map(array($this, 'buildIndexItem'), $def)) . ')'; + } + + function buildIndexItem($def) + { + if (is_array($def)) { + list($name, $size) = $def; + return $this->quoteIdentifier($name) . '(' . intval($size) . ')'; + } + return $this->quoteIdentifier($def); } /**