| 1 |
<?php |
<?php |
| 2 |
// $Id: uc_restrict_qty.install,v 1.1.2.1 2009/04/13 11:13:42 mrfelton Exp $ |
// $Id: uc_restrict_qty.install,v 1.1.2.2 2009/05/11 17:28:55 mrfelton Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 47 |
'not null' => TRUE, |
'not null' => TRUE, |
| 48 |
'default' => 0, |
'default' => 0, |
| 49 |
), |
), |
| 50 |
|
'lifetime' => array( |
| 51 |
|
'description' => t('Is restriction lifetime?'), |
| 52 |
|
'type' => 'int', |
| 53 |
|
'size' => 'tiny', |
| 54 |
|
'unsigned' => TRUE, |
| 55 |
|
'not null' => TRUE, |
| 56 |
|
'default' => 1, |
| 57 |
|
), |
| 58 |
), |
), |
| 59 |
'indexes' => array( |
'indexes' => array( |
| 60 |
'nid' => array('nid'), |
'nid' => array('nid'), |
| 82 |
*/ |
*/ |
| 83 |
function uc_restrict_qty_uninstall() { |
function uc_restrict_qty_uninstall() { |
| 84 |
drupal_uninstall_schema('uc_restrict_qty'); |
drupal_uninstall_schema('uc_restrict_qty'); |
|
|
|
| 85 |
db_query("DELETE FROM {variable} WHERE name LIKE 'uc_restrict_qty_%%'"); |
db_query("DELETE FROM {variable} WHERE name LIKE 'uc_restrict_qty_%%'"); |
| 86 |
} |
} |
| 87 |
|
|
| 88 |
/** |
/** |
| 89 |
* Implementation of hook_update_N(). |
* Implementation of hook_update_N(). |
| 90 |
* |
* |
| 91 |
* If updating from an earlier version than 6.x-2.0, the database needs to be installed. |
* If updating from an earlier version than 6.x-2.0, the database needs to be installed. |
| 92 |
*/ |
*/ |
| 93 |
function uc_restrict_qty_update_6200() { |
function uc_restrict_qty_update_6200() { |
| 94 |
$ret = array(); |
$ret = array(); |
| 95 |
uc_restrict_qty_install(); |
uc_restrict_qty_install(); |
| 96 |
return $ret; |
return $ret; |
| 97 |
} |
} |
| 98 |
|
|
| 99 |
|
|
| 100 |
|
/** |
| 101 |
|
* Add lifetime value to the scheme. |
| 102 |
|
*/ |
| 103 |
|
function uc_restrict_qty_update_6201() { |
| 104 |
|
$ret = array(); |
| 105 |
|
db_add_field($ret, 'uc_restrict_qty_products', 'lifetime', array('type' => 'int', 'size' => 'tiny', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 1)); |
| 106 |
|
return $ret; |
| 107 |
|
} |