/[drupal]/contributions/modules/views_fastsearch/contrib/vfs_ranking_nodetype/vfs_ranking_nodetype.install
ViewVC logotype

Diff of /contributions/modules/views_fastsearch/contrib/vfs_ranking_nodetype/vfs_ranking_nodetype.install

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

revision 1.1.2.1, Thu Jan 17 04:51:33 2008 UTC revision 1.1.2.2, Thu Jan 17 15:35:40 2008 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id$  // $Id: vfs_ranking_nodetype.install,v 1.1.2.1 2008/01/17 04:51:33 jacobsingh Exp $
   
 // @todo: you shouldn't modify {node_type}, but intead create your own table.  
3    
4  function vfs_ranking_nodetype_install() {  function vfs_ranking_nodetype_install() {
5    $ret = array();    switch ($GLOBALS['db_type']) {
6    $ret[] = db_query('      case 'mysql':
7    CREATE TABLE {vfs_ranking_nodetype} (      case 'mysqli':
8    `type` VARCHAR(50)  NOT NULL,        db_query("
9    `search_weight` INT  NOT NULL DEFAULT 1,          CREATE TABLE IF NOT EXISTS {vfs_ranking_nodetype} (
10    PRIMARY KEY  (`type`)            type VARCHAR(50) NOT NULL,
11    )            search_weight INT  NOT NULL DEFAULT 1,
12      ENGINE = MYISAM;            PRIMARY KEY (type)
13    ');          )
14    return $ret;        ");
15          break;
16        case 'pgsql':
17          db_query("
18            CREATE TABLE {vfs_ranking_nodetype} (
19              type VARCHAR(50) NOT NULL,
20              search_weight INTEGER NOT NULL DEFAULT 1,
21              PRIMARY KEY (type)
22            )
23          ");
24          break;
25      }
26  }  }
27    
28  function vfs_ranking_nodetype_uninstall() {  function vfs_ranking_nodetype_uninstall() {
29    $ret = array();    db_query('DROP TABLE {vfs_ranking_nodetype}');
   $ret[] = db_query('DROP TABLE {vfs_ranking_nodetype}');  
   return $ret;  
30  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.2