function system_update_150 in Drupal 5
Same name and namespace in other branches
- 4 database/updates.inc \system_update_150()
File
- modules/
system/ system.install, line 1962
Code
function system_update_150() {
$ret = array();
$ret[] = update_sql("DELETE FROM {variable} WHERE name = 'node_cron_last'");
$ret[] = update_sql("DELETE FROM {variable} WHERE name = 'minimum_word_size'");
$ret[] = update_sql("DELETE FROM {variable} WHERE name = 'remove_short'");
$ret[] = update_sql("DELETE FROM {node_counter} WHERE nid = 0");
$ret[] = update_sql('DROP TABLE {search_index}');
$ret[] = update_sql('DROP TABLE {search_total}');
switch ($GLOBALS['db_type']) {
case 'mysqli':
case 'mysql':
$ret[] = update_sql("CREATE TABLE {search_dataset} (\n sid int unsigned NOT NULL default '0',\n type varchar(16) default NULL,\n data longtext NOT NULL,\n KEY sid_type (sid, type)\n )");
$ret[] = update_sql("CREATE TABLE {search_index} (\n word varchar(50) NOT NULL default '',\n sid int unsigned NOT NULL default '0',\n type varchar(16) default NULL,\n fromsid int unsigned NOT NULL default '0',\n fromtype varchar(16) default NULL,\n score float default NULL,\n KEY sid_type (sid, type),\n KEY from_sid_type (fromsid, fromtype),\n KEY word (word)\n )");
$ret[] = update_sql("CREATE TABLE {search_total} (\n word varchar(50) NOT NULL default '',\n count float default NULL,\n PRIMARY KEY word (word)\n )");
break;
case 'pgsql':
$ret[] = update_sql("CREATE TABLE {search_dataset} (\n sid integer NOT NULL default '0',\n type varchar(16) default NULL,\n data text NOT NULL default '')");
$ret[] = update_sql("CREATE INDEX {search_dataset}_sid_type_idx ON {search_dataset}(sid, type)");
$ret[] = update_sql("CREATE TABLE {search_index} (\n word varchar(50) NOT NULL default '',\n sid integer NOT NULL default '0',\n type varchar(16) default NULL,\n fromsid integer NOT NULL default '0',\n fromtype varchar(16) default NULL,\n score float default NULL)");
$ret[] = update_sql("CREATE INDEX {search_index}_sid_type_idx ON {search_index}(sid, type)");
$ret[] = update_sql("CREATE INDEX {search_index}_fromsid_fromtype_idx ON {search_index}(fromsid, fromtype)");
$ret[] = update_sql("CREATE INDEX {search_index}_word_idx ON {search_index}(word)");
$ret[] = update_sql("CREATE TABLE {search_total} (\n word varchar(50) NOT NULL default '',\n count float default NULL,\n PRIMARY KEY(word))");
break;
default:
break;
}
return $ret;
}