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

Contents of /contributions/modules/xbview/xbview.install

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


Revision 1.2 - (show annotations) (download) (as text)
Wed Nov 14 22:47:33 2007 UTC (2 years ago) by profix898
Branch: MAIN
CVS Tags: DRUPAL-6--1-0, HEAD
Branch point for: DRUPAL-6--1
Changes since 1.1: +59 -0 lines
File MIME type: text/x-php
- Initial version for Drupal 6
1 <?php
2 // $Id: xbview.install,v 1.1.2.3 2007/05/02 14:33:10 profix898 Exp $
3
4 function xbview_schema() {
5 $schema = array();
6 $schema['xbookmark'] = array(
7 'fields' => array(
8 'id' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
9 'title' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
10 'href' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
11 'icon' => array('type' => 'text', 'not null' => TRUE, 'default' => ''),
12 'type' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
13 'parent' => array('type' => 'int', 'not null' => TRUE, 'default' => 0)
14 ),
15 'primary key' => array('id'),
16 'indexes' => array(
17 'parent' => array('parent')
18 )
19 );
20
21 return $schema;
22 }
23
24 function xbview_install() {
25 drupal_install_schema('xbview');
26 }
27
28 function xbview_uninstall() {
29 // Drop tables
30 drupal_uninstall_schema('xbview');
31 // Remove variables
32 db_query("DELETE FROM {variable} WHERE name LIKE 'xbview_%'");
33 cache_clear_all('variables', 'cache');
34 }
35
36 // Update from table-less version properly
37 function xbview_update_1() {
38 $ret = array();
39
40 $schema = array();
41 $schema['xbookmark'] = array(
42 'fields' => array(
43 'id' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
44 'title' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
45 'href' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
46 'icon' => array('type' => 'text', 'not null' => TRUE, 'default' => ''),
47 'type' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
48 'parent' => array('type' => 'int', 'not null' => TRUE, 'default' => 0)
49 ),
50 'primary key' => array('id'),
51 'indexes' => array(
52 'parent' => array('parent')
53 )
54 );
55
56 db_create_table($ret, 'xbookmark', $schema['xbookmark']);
57
58 return $ret;
59 }

  ViewVC Help
Powered by ViewVC 1.1.2