diff options
author | Brion Vibber <brion@pobox.com> | 2010-10-11 19:28:02 -0700 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-10-11 19:28:02 -0700 |
commit | 72cba8865065f5f11c9487615c161cecb16e7db6 (patch) | |
tree | 02dd6f0f0a4b5e7c8cd052e0666a94505b93e895 | |
parent | 2c9f877ab5b79f4a0734149f3769bfa0ddf4dd4d (diff) |
fix for column prefixes in table/index building
-rw-r--r-- | db/core.php | 2 | ||||
-rw-r--r-- | lib/schema.php | 11 |
2 files changed, 11 insertions, 2 deletions
diff --git a/db/core.php b/db/core.php index 0ea0bc761..f3461243f 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 acc941284..f6543a21b 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); } /** |