You are here

function linkchecker_install in Link checker 5

Same name and namespace in other branches
  1. 8 linkchecker.install \linkchecker_install()
  2. 5.2 linkchecker.install \linkchecker_install()
  3. 6.2 linkchecker.install \linkchecker_install()
  4. 7 linkchecker.install \linkchecker_install()

Implementation of hook_install().

File

./linkchecker.install, line 7

Code

function linkchecker_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query(" CREATE TABLE `linkchecker_tasks` (\n                `taskid` int(10) unsigned NOT NULL default '0',\n                `nodeid` int(10) NOT NULL default '0',\n                `status` int(10) NOT NULL default '0',\n                `update` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,\n                 PRIMARY KEY  (`taskid`)\n                 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;");
      db_query(" CREATE TABLE `linkchecker_results` (\n                 `taskid` int(10) NOT NULL default '0',\n                 `url` text NOT NULL,\n                 `response` varchar(255) NOT NULL default '0',\n                 KEY `taskid` (`taskid`)\n                 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;\n         ");
      db_query("INSERT INTO `linkchecker_tasks` ( `taskid` , `nodeid` , `status` , `update` )\n                 VALUES ('0', '0', '0', '0');");
      break;
  }
}