You are here

function counter_install in Counter 6

Same name and namespace in other branches
  1. 8 counter.install \counter_install()
  2. 5 counter.install \counter_install()
  3. 6.2 counter.install \counter_install()
  4. 7 counter.install \counter_install()

File

./counter.install, line 4

Code

function counter_install() {
  drupal_set_message('Installing Counter module');
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {counter} (\n                `counter_id`   int         NOT NULL auto_increment,\n                `counter_ip`   varchar(32) NOT NULL default '',\n                `counter_date` varchar(32) NOT NULL default '',\n                `counter_page` varchar(32) NOT NULL default '0',\n                 PRIMARY KEY (counter_id)\n              ) /*!40100 DEFAULT CHARACTER SET utf8 */");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {counter} (\n                counter_id   serial CHECK (nid >= 0),\n                counter_ip   varchar(32) NOT NULL default '',\n                counter_date varchar(32) NOT NULL default '',\n                counter_page varchar(32) NOT NULL default '0',\n                PRIMARY KEY (counter_id)\n      )");
      break;
  }
}