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

Contents of /contributions/modules/news_page/news_page.install

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


Revision 1.4 - (show annotations) (download) (as text)
Sat May 9 23:54:37 2009 UTC (6 months, 2 weeks ago) by MegaGrunt
Branch: MAIN
CVS Tags: DRUPAL-6--1-0-RC1, DRUPAL-6--1-0-BETA1, HEAD
Branch point for: DRUPAL-6--1
Changes since 1.3: +31 -28 lines
File MIME type: text/x-php
- Drupal 6 update
1 <?php
2 // $Id: news_page.install,v 1.2.2.3 2009/04/29 21:29:58 MegaGrunt Exp $
3
4 /**
5 * Implementation of hook_install()
6 */
7 function news_page_install() {
8 // Create tables.
9 drupal_install_schema('news_page');
10 }
11
12 /**
13 * Implementation of hook_schema().
14 */
15 function news_page_schema() {
16 $schema['news_page'] = array(
17 'fields' => array(
18 'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'disp-width' => 10, 'description' => t("nid of the news page node.")),
19 'include' => array('type' => 'varchar', 'length' => 255, 'description' => t("Keywords to use for filtering.")),
20 'cid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'disp-width' => 10, 'description' => t("ID of feed category.")),
21 'max_items' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'disp-width' => 10, 'description' => t("Maximum number of items to include on news page.")),
22 'search' => array('type' => 'text', 'size' => 'big', 'description' => t("Cache of the search SQL.")),
23 ),
24 'indexes' => array('nid' => array('nid')),
25 'primary key' => array('nid'),
26 );
27
28 return $schema;
29 }
30
31 /**
32 * Updates existing tables from early 4.6 install and add "search" field.
33 */
34 function news_page_update_1() {
35
36 _system_update_utf8(array('news_page'));
37
38 $items = array();
39 $items[] = update_sql('ALTER TABLE {news_page} ADD search text');
40
41 return $items;
42 }
43
44 /**
45 * Implementation of hook_uninstall().
46 */
47 function news_page_uninstall() {
48 drupal_uninstall_schema('news_page');
49 variable_del('news_page_link_prepend');
50 variable_del('news_page_channel_description');
51 }

  ViewVC Help
Powered by ViewVC 1.1.2