You are here

function views_calc_install in Views Calc 5

Same name and namespace in other branches
  1. 6.3 views_calc.install \views_calc_install()
  2. 6 views_calc.install \views_calc_install()
  3. 7 views_calc.install \views_calc_install()

File

./views_calc.install, line 2

Code

function views_calc_install() {
  global $db_type;
  switch ($db_type) {
    case 'mysql':
    case 'mysqli':
      $ret[] = db_query("CREATE TABLE if not exists {views_calc_fields} (\n        cid int(10) unsigned NOT NULL default '0',\n        label varchar(255),\n        format varchar(255),\n        custom varchar(255),\n        tablelist text,\n        fieldlist text,\n        calc text,\n        KEY (cid)\n      ) /*!40100 DEFAULT CHARACTER SET utf8 */");
      break;
    case 'postgres':
      $ret[] = db_query("CREATE TABLE if not exists {views_calc_fields} (\n        cid int(10) unsigned NOT NULL default '0',\n        label varchar(255),\n        format varchar(255),\n        custom varchar(255),\n        tablelist text,\n        fieldlist text,\n        calc text,\n        KEY (cid)\n      ) ");
      break;
  }
}