You are here

function custom_pagers_install in Custom Pagers 5

Same name and namespace in other branches
  1. 6 custom_pagers.install \custom_pagers_install()

Implementation of hook_install().

File

./custom_pagers.install, line 6

Code

function custom_pagers_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {custom_pager} (\n        pid int unsigned NOT NULL auto_increment,\n        title varchar(255) NOT NULL default '',\n        list_php text,\n        view varchar(255) NOT NULL default '',\n        args varchar(255) NOT NULL default '',\n        position varchar(16) NOT NULL default 'bottom',\n        visibility_php text,\n        node_type varchar(255) default '',\n        reverse_list tinyint NOT NULL default 1,\n        cache_list tinyint NOT NULL default 1,\n        PRIMARY KEY (pid)\n      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {custom_pager} (\n        pid serial CHECK (pid >= 0),\n        title varchar(255) NOT NULL default '',\n        list_php text,\n        view varchar(255) NOT NULL default '',\n        args varchar(255) NOT NULL default '',\n        position varchar(16) NOT NULL default 'bottom',\n        visibility_php text,\n        node_type varchar(255) default '',\n        reverse_list smallint NOT NULL default 1,\n        cache_list smallint NOT NULL default 1\n      )");
      db_query("CREATE INDEX {custom_pager}_pid_idx ON {custom_pager} (pid)");
      break;
  }
}