function uc_taxes_install in Ubercart 5
Same name and namespace in other branches
- 6.2 uc_taxes/uc_taxes.install \uc_taxes_install()
File
- uc_taxes/
uc_taxes.install, line 3
Code
function uc_taxes_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
db_query("CREATE TABLE {uc_taxes} (\n `id` mediumint(9) NOT NULL,\n `name` varchar(255) NOT NULL,\n `rate` float unsigned NOT NULL default '0',\n `shippable` tinyint UNSIGNED NOT NULL default 0,\n `taxed_product_types` text NOT NULL,\n `taxed_line_items` text NOT NULL,\n `weight` tinyint(2) NOT NULL default '0',\n PRIMARY KEY (`id`)\n ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ;");
break;
case 'pgsql':
db_query("CREATE TABLE {uc_taxes} (\n id serial NOT NULL,\n name varchar(255) NOT NULL default '',\n rate float NOT NULL default 0,\n shippable smallint_unsigned NOT NULL default 0,\n taxed_product_types text NOT NULL default '',\n taxed_line_items text NOT NULL default '',\n weight smallint NOT NULL default 0,\n PRIMARY KEY (id)\n );");
db_query("CREATE INDEX {uc_taxes}_id ON {uc_taxes} (id)");
break;
}
}