webform_component_roles.install in Webform Component Roles 6
Same filename and directory in other branches
Webform Component Roles module install/schema hooks.
@author Daniel Imhoff
File
webform_component_roles.installView source
<?php
/**
* @file
* Webform Component Roles module install/schema hooks.
*
* @author Daniel Imhoff
*/
/**
* Implements hook_schema().
*/
function webform_component_roles_schema() {
$schema = array();
$schema['webform_component_roles'] = array(
'description' => 'Table for storing the roles which can use webform components.',
'fields' => array(
'nid' => array(
'description' => 'The node identifier of a webform.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'cid' => array(
'description' => 'The identifier for this component within this node, starts at 0 for each node.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'rid' => array(
'description' => 'The role identifier.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'perms' => array(
'description' => 'The permissions the role has on the component.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => FALSE,
),
),
'primary key' => array(
'nid',
'cid',
'rid',
),
);
return $schema;
}
function webform_component_roles_install() {
drupal_install_schema('webform_component_roles');
}
function webform_component_roles_uninstall() {
drupal_uninstall_schema('webform_component_roles');
}
/**
* Change NOT NULL on perms column to permit null value.
*/
function webform_component_roles_update_6100() {
$ret = array();
db_change_field($ret, 'webform_component_roles', 'perms', 'perms', array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => FALSE,
));
return $ret;
}
Functions
Name![]() |
Description |
---|---|
webform_component_roles_install | |
webform_component_roles_schema | Implements hook_schema(). |
webform_component_roles_uninstall | |
webform_component_roles_update_6100 | Change NOT NULL on perms column to permit null value. |