You are here

function hosting_task_install in Hosting 5

Same name and namespace in other branches
  1. 6.2 task/hosting_task.install \hosting_task_install()

File

task/hosting_task.install, line 3

Code

function hosting_task_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {hosting_task} (\n      vid int(10) unsigned NOT NULL default '0',\n      nid int(10) unsigned NOT NULL default '0',\n      task_type longtext,\n      rid int(11) NOT NULL default '0',\n      task_status int(11) default NULL,\n      executed int(11) default NULL,\n    PRIMARY KEY  (vid)\n    ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
      db_query("CREATE TABLE {hosting_task_arguments} (\n      vid int(10) unsigned NOT NULL default '0',\n      nid int(10) unsigned NOT NULL default '0',\n      name longtext,\n      value longtext\n    ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");

      # Logging table for backend task calls
      db_query("CREATE TABLE {hosting_task_log} (\n      lid int NOT NULL auto_increment,\n      vid int NOT NULL default '0',\n      type varchar(16) NOT NULL default '',\n      message longtext NOT NULL,\n      error longtext NOT NULL default '',\n      timestamp int NOT NULL default '0',\n      PRIMARY KEY (lid),\n      KEY (type)\n    ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");

      # Task queue
      db_query("CREATE TABLE {hosting_task_queue} (\n      nid int NOT NULL default '0',\n      timestamp int NOT NULL default '0',\n      status tinyint unsigned NOT NULL default 0,\n      PRIMARY KEY (nid)\n    ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
      break;
  }
}