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

Diff of /contributions/modules/interests/interests.install

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

revision 1.4, Sat Nov 3 04:11:11 2007 UTC revision 1.4.2.1, Tue Sep 9 04:15:13 2008 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: interests.install,v 1.3 2007/11/03 04:10:36 auriar Exp $  // $Id: interests.install,v 1.4 2007/11/03 04:11:11 auriar Exp $
3    
4  /**  /**
5   * Implementation of hook_install().   * Implementation of hook_install().
# Line 15  function interests_install() { Line 15  function interests_install() {
15          counter int(10) unsigned NOT NULL DEFAULT '0',          counter int(10) unsigned NOT NULL DEFAULT '0',
16          PRIMARY KEY  (uid,tid)          PRIMARY KEY  (uid,tid)
17        ) /*!40100 DEFAULT CHARACTER SET utf8 */;");        ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
                         $status[] = db_query("CREATE TABLE {interests_vocabs} (  
                                 vid int(10) unsigned NOT NULL DEFAULT '0',  
                                 PRIMARY KEY (vid)  
                         ) /*!40100 DEFAULT CHARACTER SET utf8 */;");  
       break;  
   
     case 'pgsql':  
       $status[] = db_query("CREATE TABLE {interests} (  
         uid integer NOT NULL DEFAULT '0',  
         tid integer NOT NULL DEFAULT '0',  
         counter integer NOT NULL DEFAULT '0',  
         PRIMARY KEY (uid,tid)  
       );");  
18        $status[] = db_query("CREATE TABLE {interests_vocabs} (        $status[] = db_query("CREATE TABLE {interests_vocabs} (
19          id integer NOT NULL DEFAULT '0',          vid int(10) unsigned NOT NULL DEFAULT '0',
         vid integer NOT NULL DEFAULT '0',  
20          PRIMARY KEY (vid)          PRIMARY KEY (vid)
21        );");        ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
22        break;        break;
23    }    }
24    
# Line 45  function interests_install() { Line 31  function interests_install() {
31    }    }
32  }  }
33    
34    // apply updates for those using the initial release
35    function interests_update_1() {
36      switch ($GLOBALS['db_type']) {
37        case 'mysql':
38        case 'mysqli':
39          $ret[] = update_sql("CREATE TABLE {interests_vocabs} (
40            vid int(10) unsigned NOT NULL DEFAULT '0',
41            PRIMARY KEY (vid)
42          ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
43        break;
44      }
45      return $ret ? $ret : array();
46    }
47    
48  function interests_uninstall(){  function interests_uninstall(){
49          if (db_table_exists('interests')) {    if (db_table_exists('interests')) {
50                  db_query("DROP TABLE {interests}");      db_query("DROP TABLE {interests}");
51                  db_query("DROP TABLE {interests_vocabs}");      db_query("DROP TABLE {interests_vocabs}");
52          }    }
53  }  }
   

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

  ViewVC Help
Powered by ViewVC 1.1.2