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

Contents of /contributions/modules/node_annotate/node_annotate.install

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


Revision 1.3 - (show annotations) (download) (as text)
Sat Feb 9 19:48:03 2008 UTC (21 months, 2 weeks ago) by tc1415
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-5
Changes since 1.2: +2 -2 lines
File MIME type: text/x-php
Final fixes for a branch and -dev release
1 <?php
2 // $Id: node_annotate.install,v 1.2 2008/02/08 20:55:52 tc1415 Exp $
3
4 /**
5 * Implementation of hook_install
6 */
7 function node_annotate_install() {
8 $sql = 'CREATE TABLE {node_annotate} (
9 `vid` INT(10) NOT NULL,
10 `nid` INT(10) NOT NULL,
11 `description` LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
12 `annotations` LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
13 PRIMARY KEY (`vid`),
14 INDEX (`nid`));';
15
16 db_query($sql);
17 }
18
19 /**
20 * Implmentation of hook_uninstall
21 */
22 function node_annotate_uninstall() {
23 $sql = 'DROP TABLE {node_annotate}';
24 db_query($sql);
25 }
26
27 /**
28 * First update
29 *
30 * Fixes incorrect collations
31 */
32 function node_annotate_update_1() {
33 $sql = 'ALTER TABLE {node_annotate}
34 CHANGE `annotation` `annotation` LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
35 CHANGE `lines` `lines` LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL';
36
37 $return[] = update_sql($sql);
38
39 return $return;
40 }
41
42 /**
43 * Second Update
44 *
45 * Rename Annotation -> Description
46 * " Lines -> Annotations
47 */
48 function node_annotate_update_2() {
49 $sql = 'ALTER TABLE {node_annotate}
50 CHANGE `annotation` `description` LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
51 CHANGE `lines` `annotations` LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL';
52
53 $return[] = update_sql($sql);
54
55 return $return;
56 }

  ViewVC Help
Powered by ViewVC 1.1.2