| 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 |
}
|