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

Contents of /contributions/modules/signup_restrict_by_role/signup_restrict_by_role.install

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


Revision 1.3 - (show annotations) (download) (as text)
Mon May 18 13:27:44 2009 UTC (6 months, 1 week ago) by ebeyrent
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +8 -1 lines
File MIME type: text/x-php
Fixed issue reported at http://drupal.org/node/450632, caused by bad schema created on install.  Run update 6001 to fix the issue
1 <?php
2 // $Id: signup_restrict_by_role.install,v 1.2 2009/04/29 11:36:21 ebeyrent Exp $
3
4 /**
5 * implementation of hook_schema
6 */
7 function signup_restrict_by_role_schema() {
8 $schema['signup_restrict_by_role'] = array(
9 'fields' => array(
10 'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
11 'rid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
12 ),
13 'primary key' => array('nid'),
14 'indexes' => array(
15 'nid' => array('nid', 'rid'),
16 ),
17 );
18 return $schema;
19 }
20
21 /**
22 * implementation of hook_install
23 */
24 function signup_restrict_by_role_install() {
25 drupal_install_schema('signup_restrict_by_role');
26 }
27
28 /**
29 * Implementation of hook_uninstall().
30 */
31 function signup_restrict_by_role_uninstall() {
32 drupal_uninstall_schema('signup_restrict_by_role');
33 }
34
35 function signup_restrict_by_role_update_6001() {
36 $items = array();
37 db_drop_primary_key($items, 'signup_restrict_by_role');
38 db_add_unique_key($items, 'signup_restrict_by_role', 'nid_rid', array('nid', 'rid'));
39 return $items;
40 }

  ViewVC Help
Powered by ViewVC 1.1.2