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

Diff of /contributions/modules/type_local_nids/type_local_nids.install

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

revision 1.1, Sun Mar 23 02:29:00 2008 UTC revision 1.1.4.1, Tue Mar 25 03:04:13 2008 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id$  // $Id: type_local_nids.install,v 1.2 2008/03/23 02:48:30 jbrown Exp $
   
   
 function type_local_nids_schema() {  
   
         $schema['node_lnid_next'] = array(  
                 'description' => t('Maintains the next lnid for each node type.'),  
                 'fields' => array(  
                         'type' => array(  
                                 'description' => t('The node type.'),  
                                 'type' => 'varchar',  
                                 'length' => 32,  
                                 'not null' => TRUE  
                         ),  
                         'next_lnid' => array(  
                                 'description' => t('The next lnid.'),  
         'type' => 'int',  
         'unsigned' => TRUE,  
         'not null' => TRUE  
                         )  
                 ),  
                 'primary key' => array('type')  
         );  
   
         $schema['node_lnid'] = array(  
                 'description' => t('Maintains the lnid for each node'),  
                 'fields' => array(  
                         'nid' => array(  
                                 'description' => t('The nid.'),  
         'type' => 'int',  
         'unsigned' => TRUE,  
         'not null' => TRUE  
                         ),  
                         'lnid' => array(  
                                 'description' => t('The lnid.'),  
         'type' => 'int',  
         'unsigned' => TRUE,  
         'not null' => TRUE  
                         )  
                 ),  
                 'primary key' => array('nid')  
         );  
   
         return $schema;  
 }  
3    
4    
5  function type_local_nids_install() {  function type_local_nids_install() {
6          drupal_install_schema('type_local_nids');  
7            switch ($GLOBALS['db_type']) {
8                    case 'mysql':
9                    case 'mysqli':
10    
11                            db_query("
12                                    CREATE TABLE {node_lnid_next} (
13                                            type VARCHAR(32) NOT NULL,
14                                            next_lnid INT(10) UNSIGNED NOT NULL,
15                                            PRIMARY KEY (type)
16                                    )
17                            ");
18    
19                            db_query("
20                                    CREATE TABLE {node_lnid} (
21                                            nid INT(10) UNSIGNED NOT NULL,
22                                            lnid INT(10) UNSIGNED NOT NULL,
23                                            PRIMARY KEY (nid)
24                                    )
25                            ");
26    
27                            break;
28    
29                    case 'pgsql':
30                            break;
31            }
32  }  }
33    
34    
35  function type_local_nids_uninstall() {  function type_local_nids_uninstall() {
36          drupal_uninstall_schema('type_local_nids');    db_query('DROP TABLE {node_lnid_next}');
37      db_query('DROP TABLE {node_lnid}');
38  }  }
39    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.1.4.1

  ViewVC Help
Powered by ViewVC 1.1.2