/[drupal]/contributions/modules/geshifilter/geshinode.install
ViewVC logotype

Diff of /contributions/modules/geshifilter/geshinode.install

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

revision 1.4, Mon Jul 21 17:44:23 2008 UTC revision 1.5, Mon Jul 6 22:45:53 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: geshinode.install,v 1.3 2008/01/07 01:20:40 soxofaan Exp $  // $Id: geshinode.install,v 1.4 2008/07/21 17:44:23 soxofaan Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 15  function geshinode_schema() { Line 15  function geshinode_schema() {
15      'fields' => array(      'fields' => array(
16        'nid' => array(        'nid' => array(
17          'description' => t('The primary identifier for a node.'),          'description' => t('The primary identifier for a node.'),
18          'type' => 'serial',          'type' => 'int',
19          'unsigned' => TRUE,          'unsigned' => TRUE,
20          'not null' => TRUE,          'not null' => TRUE,
21        ),        ),
# Line 34  function geshinode_schema() { Line 34  function geshinode_schema() {
34          'default' => '',          'default' => '',
35        ),        ),
36      ),      ),
37      'primary key' => array('nid'),      'primary key' => array('vid'),
38      'unique keys' => array(      'indexes' => array('nid' => array('nid')),
       'vid' => array('vid'),  
     ),  
39    );    );
40    return $schema;    return $schema;
41  }  }
# Line 57  function geshinode_uninstall() { Line 55  function geshinode_uninstall() {
55    // Drop geshinode tables.    // Drop geshinode tables.
56    drupal_uninstall_schema('geshinode');    drupal_uninstall_schema('geshinode');
57  }  }
58    
59    
60    /**
61     * Implementation of hook_update_N().
62     *
63     * Fix the primary key and indices on the geshinode table.
64     * See http://drupal.org/node/363770 .
65     */
66    function geshinode_update_6001() {
67      $ret = array();
68      // Drop unique key on 'vid'.
69      db_drop_unique_key($ret, 'geshinode', 'vid');
70      // Change the 'nid' field to 'int' (from 'serial').
71      db_change_field($ret, 'geshinode', 'nid', 'nid',
72        array(
73          'description' => t('The primary identifier for a node.'),
74          'type' => 'int',
75          'unsigned' => TRUE,
76          'not null' => TRUE,
77        )
78      );
79      // Drop primary key ('nid').
80      db_drop_primary_key($ret, 'geshinode');
81      // Add primary key on 'vid'.
82      db_add_primary_key($ret, 'geshinode', array('vid'));
83      // Add an index on 'nid'.
84      db_add_index($ret, 'geshinode', 'nid', array('nid'));
85      return $ret;
86    }

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.2