You are here

function uc_product_kit_install in Ubercart 5

Same name and namespace in other branches
  1. 8.4 uc_product_kit/uc_product_kit.install \uc_product_kit_install()
  2. 6.2 uc_product_kit/uc_product_kit.install \uc_product_kit_install()

File

uc_product_kit/uc_product_kit.install, line 3

Code

function uc_product_kit_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {uc_product_kits} (\n        `vid` mediumint(9) NOT NULL default 0,\n        `nid` mediumint(9) NOT NULL default 0,\n        `product_id` mediumint(9) NOT NULL,\n        `mutable` tinyint(1) NOT NULL default 0,\n        `qty` smallint(6) NOT NULL,\n        `discount` float NOT NULL default 0.0,\n        `ordering` smallint NOT NULL default 0,\n        PRIMARY KEY  (`vid`, `product_id`)\n      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ;");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {uc_product_kits} (\n        vid integer NOT NULL default 0,\n        nid integer NOT NULL default 0,\n        product_id integer NOT NULL default 0,\n        mutable smallint NOT NULL default 0,\n        qty smallint NOT NULL default 0,\n        discount float NOT NULL default 0.0,\n        ordering smallint NOT NULL default 0,\n        PRIMARY KEY  (vid, product_id)\n      );");
      break;
  }
}