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

Contents of /contributions/modules/relativity/relativity.install

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


Revision 1.3 - (show annotations) (download) (as text)
Wed Jul 4 14:59:26 2007 UTC (2 years, 4 months ago) by darius
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-6--1
Changes since 1.2: +11 -0 lines
File MIME type: text/x-php
Bringing HEAD up to date with the last 3 patches in DRUPAL-5--2 branch
1 <?php
2 // $Id:$
3
4 function relativity_install() {
5 switch ($GLOBALS['db_type']) {
6 case 'mysql':
7 case 'mysqli':
8 db_query("CREATE TABLE {relativity} (
9 nid int(10) unsigned NOT NULL default '0',
10 parent_nid int(10) unsigned NOT NULL default '0',
11 KEY nid (nid),
12 KEY parent_nid (nid)
13 ) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;");
14
15 db_query("CREATE TABLE {relativity_query} (
16 nid int(10) unsigned NOT NULL default '0',
17 target_nid int(10) unsigned,
18 follow_parents int(10) unsigned,
19 follow_children int(10) unsigned,
20 recursion_depth int(10) unsigned,
21 unique_types int(10) unsigned,
22 max_results int(10) unsigned,
23 options longtext,
24 search_algorithm varchar(20) default 'dfs',
25 search_types longtext,
26 end_pts longtext,
27 avoid_pts longtext,
28 KEY nid (nid)
29 ) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;");
30
31 break;
32
33 /*
34 case 'pgsql':
35 break;
36 */
37 }
38 }
39
40 function relativity_update_1() {
41 return _system_update_utf8(array('relativity', 'relativity_query'));
42 }
43
44 function relativity_update_2() {
45 $items = array();
46 $items[] = update_sql("ALTER TABLE relativity DROP INDEX parent_nid,
47 ADD INDEX parent_nid (parent_nid)");
48 return $items;
49 }
50
51 function relativity_uninstall() {
52 switch ($GLOBALS['db_type']) {
53 case 'mysql':
54 case 'mysqli':
55 db_query("DROP TABLE {relativity}");
56 db_query("DROP TABLE {relativity_query}");
57 break;
58 }
59 }

  ViewVC Help
Powered by ViewVC 1.1.2