View source
<?php
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;
}
}
function linkchecker_uninstall() {
db_query('DROP TABLE {linkchecker_tasks}');
db_query('DROP TABLE {linkchecker_results}');
}
function linkchecker_update_1000() {
$ret = array();
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
$ret[] = update_sql("CREATE TABLE `linkchecker_tasks` (\n `taskid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT ,\n `nodeid` INT( 10 ) NOT NULL ,\n `status` INT( 10 ) DEFAULT '0' NOT NULL ,\n `update` TIMESTAMP ON UPDATE CURRENT_TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,\n PRIMARY KEY ( `taskid` )\n ) TYPE = MYISAM;");
$ret[] = update_sql("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; ");
break;
}
return $ret;
}