| 1 |
<?php
|
| 2 |
// $Id$
|
| 3 |
|
| 4 |
/**
|
| 5 |
* Implementation of hook_install().
|
| 6 |
*/
|
| 7 |
function ec_inventory_install() {
|
| 8 |
switch ($GLOBALS['db_type']) {
|
| 9 |
case 'mysql':
|
| 10 |
case 'mysqli':
|
| 11 |
db_query("CREATE TABLE {ec_inventory_types} (
|
| 12 |
ptype varchar(255) NOT NULL default '',
|
| 13 |
inventory_enabled int NOT NULL default '0',
|
| 14 |
PRIMARY KEY (ptype)
|
| 15 |
) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
|
| 16 |
break;
|
| 17 |
case 'pgsql':
|
| 18 |
db_query("CREATE TABLE {ec_inventory_types} (
|
| 19 |
ptype varchar(255) NOT NULL default '',
|
| 20 |
inventory_enabled int unsigned NOT NULL default '0',
|
| 21 |
PRIMARY KEY (ptype)
|
| 22 |
)");
|
| 23 |
break;
|
| 24 |
}
|
| 25 |
}
|
| 26 |
|
| 27 |
/**
|
| 28 |
* Implementation of hook_uninstall().
|
| 29 |
*/
|
| 30 |
function sale_uninstall() {
|
| 31 |
db_query("DROP TABLE {ec_inventory_types}");
|
| 32 |
}
|
| 33 |
|