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

Diff of /contributions/modules/uc_restrict_qty/uc_restrict_qty.install

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

revision 1.1.2.2, Mon May 11 17:28:55 2009 UTC revision 1.1.2.3, Sun May 17 09:10:45 2009 UTC
# Line 1  Line 1 
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
# Line 47  function uc_restrict_qty_schema() { Line 47  function uc_restrict_qty_schema() {
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'),
# Line 74  function uc_restrict_qty_install() { Line 82  function uc_restrict_qty_install() {
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    }

Legend:
Removed from v.1.1.2.2  
changed lines
  Added in v.1.1.2.3

  ViewVC Help
Powered by ViewVC 1.1.2