You are here

function system_update_6015 in Drupal 6

Add the form cache table.

Related topics

File

modules/system/system.install, line 1460

Code

function system_update_6015() {
  $ret = array();
  switch ($GLOBALS['db_type']) {
    case 'pgsql':
      $ret[] = update_sql("CREATE TABLE {cache_form} (\n        cid varchar(255) NOT NULL default '',\n        data bytea,\n        expire int NOT NULL default '0',\n        created int NOT NULL default '0',\n        headers text,\n        serialized smallint NOT NULL default '0',\n        PRIMARY KEY (cid)\n    )");
      $ret[] = update_sql("CREATE INDEX {cache_form}_expire_idx ON {cache_form} (expire)");
      break;
    case 'mysql':
    case 'mysqli':
      $ret[] = update_sql("CREATE TABLE {cache_form} (\n        cid varchar(255) NOT NULL default '',\n        data longblob,\n        expire int NOT NULL default '0',\n        created int NOT NULL default '0',\n        headers text,\n        serialized int(1) NOT NULL default '0',\n        PRIMARY KEY (cid),\n        INDEX expire (expire)\n      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
      break;
  }
  return $ret;
}