You are here

function textimage_update_1 in Textimage 5.2

Same name and namespace in other branches
  1. 5 textimage.install \textimage_update_1()
  2. 6.2 textimage.install \textimage_update_1()

Implementation of hook_update_N().

Install the textimage tables and seperate variable names for captcha specific variables

File

./textimage.install, line 113

Code

function textimage_update_1() {
  $ret = array();
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      $ret[] = update_sql("CREATE TABLE {textimage_preset} (\n        pid INT UNSIGNED NOT NULL PRIMARY KEY,\n        name VARCHAR(255) NOT NULL DEFAULT '',\n        settings TEXT NOT NULL DEFAULT '' )\n        /*!40100 DEFAULT CHARACTER SET utf8 */");
      break;
    case 'pgsql':
      $ret[] = update_sql("CREATE TABLE {textimage_preset} (\n        pid INTEGER NOT NULL CHECK (pid > 0),\n        name VARCHAR(255) NOT NULL DEFAULT '',\n        settings TEXT NOT NULL DEFAULT ''\n        PRIMARY KEY (pid));");
      $ret[] = update_sql("CREATE SEQUENCE {textimage_preset_pid_seq} INCREMENT 1 START 1;");
      break;
  }
  return $ret;
}