You are here

function statistics_install in Drupal 5

Same name and namespace in other branches
  1. 6 modules/statistics/statistics.install \statistics_install()

Implementation of hook_install().

File

modules/statistics/statistics.install, line 6

Code

function statistics_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {accesslog} (\n        aid int NOT NULL auto_increment,\n        sid varchar(64) NOT NULL default '',\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 int unsigned default '0',\n        timer int unsigned NOT NULL default '0',\n        timestamp int unsigned NOT NULL default '0',\n        KEY accesslog_timestamp (timestamp),\n        PRIMARY KEY (aid)\n      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {accesslog} (\n        aid serial,\n        sid varchar(64) NOT NULL default '',\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 int_unsigned default '0',\n        timer int_unsigned NOT NULL default '0',\n        timestamp int_unsigned NOT NULL default '0',\n        PRIMARY KEY (aid)\n      )");
      db_query("CREATE INDEX {accesslog}_accesslog_timestamp_idx ON {accesslog} (timestamp)");
      break;
  }
}