You are here

function session_api_install in Session API 5

Same name and namespace in other branches
  1. 6 session_api.install \session_api_install()

Implementation of hook_install().

File

./session_api.install, line 7

Code

function session_api_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {session_api} (\n        sid int NOT NULL,\n        session_id varchar(64) NOT NULL,\n        PRIMARY KEY (sid),\n        UNIQUE (session_id)\n      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {session_api} (\n        sid int NOT NULL default '0',\n        session_id varchar(64) NOT NULL default '0',\n        PRIMARY KEY (sid),\n        UNIQUE (session_id)\n      )");
      break;
  }
}