function system_update_113 in Drupal 4
Same name and namespace in other branches
- 5 modules/system/system.install \system_update_113()
File
- database/
updates.inc, line 123
Code
function system_update_113() {
$ret = array();
if ($GLOBALS['db_type'] == 'mysql') {
$ret[] = update_sql('ALTER TABLE {accesslog} ADD aid int(10) NOT NULL auto_increment, ADD PRIMARY KEY (aid)');
}
elseif ($GLOBALS['db_type'] == 'pgsql') {
$ret[] = update_sql("SELECT * INTO TEMPORARY {accesslog}_t FROM {accesslog}");
$ret[] = update_sql("DROP TABLE {accesslog}");
$ret[] = update_sql("CREATE TABLE {accesslog} (\n aid serial,\n title varchar(255) default NULL,\n path varchar(255) default NULL,\n url varchar(255) default NULL,\n hostname varchar(128) default NULL,\n uid integer default '0',\n timestamp integer NOT NULL default '0'\n )");
$ret[] = update_sql("INSERT INTO {accesslog} (title, path, url, hostname, uid, timestamp) SELECT title, path, url, hostname, uid, timestamp FROM {accesslog}_t");
$ret[] = update_sql("DROP TABLE {accesslog}_t");
$ret[] = update_sql("CREATE INDEX {accesslog}_timestamp_idx ON {accesslog} (timestamp);");
}
// Flush the menu cache:
cache_clear_all('menu:', TRUE);
return $ret;
}