You are here

function uc_cart_install in Ubercart 5

Same name and namespace in other branches
  1. 6.2 uc_cart/uc_cart.install \uc_cart_install()

Ubercart uc_cart.module schema

File

uc_cart/uc_cart.install, line 6

Code

function uc_cart_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {uc_cart_products} (\n        cart_id varchar(32) NOT NULL default '0',\n        nid int(10) NOT NULL default '0',\n        qty int(10) NOT NULL default '0',\n        changed int(11) NOT NULL default '0',\n        data text,\n        KEY cart_id (cart_id)\n      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {uc_cart_products} (\n        cart_id varchar(32) NOT NULL default 0,\n        nid integer NOT NULL default 0,\n        qty integer NOT NULL default 0,\n        changed integer NOT NULL default 0,\n        data text\n      )");
      db_query("CREATE INDEX {uc_cart_products}_cart_id ON {uc_cart_products} (cart_id)");
      break;
  }
}