Commit 7f85bc5b authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

#208938 by bjaspan, scor: use schema PI for index updates instead of database dependent code

parent 52553977
......@@ -62,7 +62,8 @@ function comment_update_6002() {
* Add index to parent ID field.
*/
function comment_update_6003() {
$ret[] = update_sql("ALTER TABLE {comments} ADD KEY pid (pid)");
$ret = array();
db_add_index($ret, 'comments', 'pid', array('pid'));
return $ret;
}
......
......@@ -1114,16 +1114,7 @@ function system_update_last_removed() {
*/
function system_update_1022() {
$ret = array();
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
$ret[] = update_sql('ALTER TABLE {users} ADD KEY created (created)');
break;
case 'pgsql':
$ret[] = update_sql("CREATE INDEX {users}_created_idx ON {users} (created)");
break;
}
db_add_index($ret, 'users', 'created', array('created'));
// Also appears as system_update_6004(). Ensure we don't update twice.
variable_set('system_update_1022', TRUE);
return $ret;
......@@ -1187,16 +1178,7 @@ function system_update_6002() {
*/
function system_update_6003() {
$ret = array();
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
$ret[] = update_sql('ALTER TABLE {comments} ADD KEY status (status)');
break;
case 'pgsql':
$ret[] = update_sql("CREATE INDEX {comments}_status_idx ON {comments} (status)");
break;
}
db_add_index($ret, 'comments', 'status', array('status'));
return $ret;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment