function user_update_7006

Add module data to {role_permission}.

Related topics

File

drupal/modules/user/user.install, line 602
Install, update and uninstall functions for the user module.

Code

function user_update_7006(&$sandbox) {
  $module_field = array(
    'type' => 'varchar',
    'length' => 255,
    'not null' => TRUE,
    'default' => '',
    'description' => "The module declaring the permission.",
  );

  // Check that the field hasn't been updated in an aborted run of this
  // update.
  if (!db_field_exists('role_permission', 'module')) {

    // Add a new field for the fid.
    db_add_field('role_permission', 'module', $module_field);
  }
}