function user_update_7006

7.x user.install user_update_7006(&$sandbox)

Add module data to {role_permission}.

Related topics

File

drupal-7.x/modules/user/user.install, line 597
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);
  }
}