You are here

function book_access_update_6204 in Book access 6.2

Implements hook_update_N().

File

./book_access.install, line 321

Code

function book_access_update_6204() {
  $ret = array();
  db_drop_primary_key($ret, 'book_access_role');
  db_change_field($ret, 'book_access_role', 'rid', 'rid', array(
    'type' => 'int',
    'unsigned' => TRUE,
    'not null' => TRUE,
    'default' => 0,
  ));
  db_change_field($ret, 'book_access_role', 'grant_view', 'grant_view', array(
    'type' => 'int',
    'unsigned' => TRUE,
    'not null' => TRUE,
    'default' => 0,
  ));
  db_change_field($ret, 'book_access_role', 'grant_update', 'grant_update', array(
    'type' => 'int',
    'unsigned' => TRUE,
    'not null' => TRUE,
    'default' => 0,
  ));
  db_change_field($ret, 'book_access_role', 'grant_delete', 'grant_delete', array(
    'type' => 'int',
    'unsigned' => TRUE,
    'not null' => TRUE,
    'default' => 0,
  ));
  db_add_primary_key($ret, 'book_access_role', array(
    'nid',
    'rid',
  ));
  db_drop_primary_key($ret, 'book_access_user');
  db_change_field($ret, 'book_access_user', 'uid', 'uid', array(
    'type' => 'int',
    'unsigned' => TRUE,
    'not null' => TRUE,
    'default' => 0,
  ));
  db_change_field($ret, 'book_access_user', 'grant_view', 'grant_view', array(
    'type' => 'int',
    'unsigned' => TRUE,
    'not null' => TRUE,
    'default' => 0,
  ));
  db_change_field($ret, 'book_access_user', 'grant_update', 'grant_update', array(
    'type' => 'int',
    'unsigned' => TRUE,
    'not null' => TRUE,
    'default' => 0,
  ));
  db_change_field($ret, 'book_access_user', 'grant_delete', 'grant_delete', array(
    'type' => 'int',
    'unsigned' => TRUE,
    'not null' => TRUE,
    'default' => 0,
  ));
  db_add_primary_key($ret, 'book_access_user', array(
    'nid',
    'uid',
  ));
  return $ret;
}