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

Contents of /contributions/modules/uc_userpoints_discount/uc_userpoints_discount.install

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


Revision 1.1 - (show annotations) (download) (as text)
Mon May 5 19:16:10 2008 UTC (18 months, 2 weeks ago) by rszrama
Branch: MAIN
CVS Tags: DRUPAL-5--1-0, HEAD
Branch point for: DRUPAL-5
File MIME type: text/x-php
Initial upload to provide per-product discounts based on a user's userpoints and the site-wide points to currency conversion rate.
1 <?php
2 // $Id$
3
4 /**
5 * Implementation of hook_install().
6 */
7 function uc_userpoints_discount_install() {
8 switch ($GLOBALS['db_type']) {
9 case 'mysql':
10 case 'mysqli':
11 db_query("CREATE TABLE {uc_product_userpoints_discount} (
12 nid mediumint(9) UNSIGNED NOT NULL,
13 discount_status smallint UNSIGNED NOT NULL,
14 PRIMARY KEY (nid)
15 ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
16 db_query("CREATE TABLE {uc_userpoints_discount_txns} (
17 txn_id int unsigned NOT NULL,
18 uid int unsigned NOT NULL,
19 order_id mediumint unsigned NOT NULL,
20 amount int NOT NULL,
21 txn_status int unsigned NOT NULL,
22 expires int NOT NULL,
23 PRIMARY KEY (txn_id),
24 KEY uid (uid),
25 KEY order_id (order_id),
26 KEY txn_status (txn_status)
27 ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
28 break;
29 }
30 }
31
32 function uc_userpoints_discount_uninstall() {
33 db_query("DROP TABLE {uc_product_userpoints_discount}");
34 db_query("DROP TABLE {uc_userpoints_discount_txns}");
35 variable_del('uc_userpoints_discount_rate');
36 }
37

  ViewVC Help
Powered by ViewVC 1.1.2