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

Contents of /contributions/modules/book_access/book_access.install

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


Revision 1.4 - (show annotations) (download) (as text)
Fri Sep 5 23:35:45 2008 UTC (14 months, 3 weeks ago) by add1sun
Branch: MAIN
CVS Tags: DRUPAL-6--1-0-RC1, DRUPAL-6--1-0-RC2, HEAD
Branch point for: DRUPAL-6--1
Changes since 1.3: +58 -34 lines
File MIME type: text/x-php
#278552: updating HEAD to D6 from afly's original work, along with some tweaks and updating the install file.
1 <?php
2 // $Id: book_access.install,v 1.3 2007/11/29 21:52:00 hlslaughter Exp $
3
4 /**
5 * Implementation of hook_install().
6 */
7 function book_access_install() {
8 drupal_install_schema('book_access');
9
10 // not sure we need this
11 //db_query("UPDATE {system} SET weight = 2 WHERE name = 'book_access'");
12
13 drupal_set_message("Book access database tables created.");
14 }
15
16 /**
17 * Implementation of hook_schema().
18 */
19 function book_access_schema() {
20 $schema['book_access'] = array(
21 'description' => t('Table for tracking book access.'),
22 'fields' => array(
23 'nid' => array(
24 'description' => t('Primary key: The node ID of the book.'),
25 'type' => 'int',
26 'not null' => TRUE,
27 'default' => 0,
28 ),
29 'rid' => array(
30 'description' => t('Primary key: A role ID associated with a book node ID.'),
31 'type' => 'int',
32 'not null' => TRUE,
33 'default' => 0,
34 ),
35 'grant_view' => array(
36 'description' => t('View book is allowed. 1 = TRUE, 0 = FALSE.'),
37 'type' => 'int',
38 'size' => 'tiny',
39 'insigned' => TRUE,
40 'not null' => TRUE,
41 'default' => 0,
42 ),
43 'grant_update' => array(
44 'description' => t('Edit book pages is allowed. 1 = TRUE, 0 = FALSE.'),
45 'type' => 'int',
46 'size' => 'tiny',
47 'insigned' => TRUE,
48 'not null' => TRUE,
49 'default' => 0,
50 ),
51 'grant_delete' => array(
52 'description' => t('Delete book pages is allowed. 1 = TRUE, 0 = FALSE.'),
53 'type' => 'int',
54 'size' => 'tiny',
55 'insigned' => TRUE,
56 'not null' => TRUE,
57 'default' => 0,
58 ),
59 ),
60 'primary key' => array('nid', 'rid'),
61 );
62
63 return $schema;
64 }
65
66 /**
67 * Implementation of hook_uninstall().
68 */
69 function book_access_uninstall() {
70 drupal_uninstall_schema('book_access');
71 }

  ViewVC Help
Powered by ViewVC 1.1.2