/[drupal]/contributions/modules/ec_inventory/ec_inventory.install
ViewVC logotype

Contents of /contributions/modules/ec_inventory/ec_inventory.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download) (as text)
Fri May 4 23:11:24 2007 UTC (2 years, 6 months ago) by darrenoh
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-5
File MIME type: text/x-php
Allow inventory management for any product type.
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

  ViewVC Help
Powered by ViewVC 1.1.2