function system_update_144 in Drupal 4
Same name and namespace in other branches
- 5 modules/system/system.install \system_update_144()
File
- database/
updates.inc, line 650
Code
function system_update_144() {
$ret = array();
if ($GLOBALS['db_type'] == 'mysql') {
$ret[] = update_sql("ALTER TABLE {node} CHANGE type type VARCHAR(32) NOT NULL");
}
elseif ($GLOBALS['db_type'] == 'pgsql') {
$ret[] = update_sql("DROP INDEX {node}_type_idx");
// Drop indexes using "type" column
$ret[] = update_sql("DROP INDEX {node}_title_idx");
db_change_column($ret, 'node', 'type', 'type', 'varchar(32)', array(
'not null' => TRUE,
'default' => "''",
));
// Let's recreate the indexes
$ret[] = update_sql("CREATE INDEX {node}_type_idx ON {node}(type)");
$ret[] = update_sql("CREATE INDEX {node}_title_type_idx ON {node}(title,type)");
$ret[] = update_sql("CREATE INDEX {node}_status_type_nid_idx ON {node}(status,type,nid)");
}
return $ret;
}