You are here

function access_update_7102 in Access Control Kit 7

Convert schemes to entities.

File

./access.install, line 230
Install, update and uninstall functions for the access control kit module.

Code

function access_update_7102() {

  // Entities are required to have an integer ID.
  db_drop_primary_key('access_scheme');
  db_add_field('access_scheme', 'sid', array(
    'description' => 'The scheme ID.',
    'type' => 'serial',
  ), array(
    'primary key' => array(
      'sid',
    ),
  ));

  // Rename and index the machine name field.
  db_change_field('access_scheme', 'scheme', 'machine_name', array(
    'description' => 'The machine-readable name of this scheme.',
    'type' => 'varchar',
    'length' => 28,
    'not null' => TRUE,
  ), array(
    'unique keys' => array(
      'machine_name' => array(
        'machine_name',
      ),
    ),
  ));
}