'The base table for Taxonomy Role Access records.', 'fields' => array( 'entry_id' => array( 'description' => 'Table entry identifier.', 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'auto_increment' => TRUE, ), 'tid' => array( 'description' => 'Taxonomy term identifier.', 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, ), 'rid' => array( 'description' => 'User role identifier.', 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, ), ), 'indexes' => array( 'taxonomy_tools_role_access_tid' => array('tid'), 'taxonomy_tools_role_access_rid' => array('rid'), ), 'primary key' => array('entry_id'), ); return $schema; } /** * Implements hook_uninstall(). */ function taxonomy_tools_role_access_uninstall() { variable_del('taxonomy_tools_role_access_vocab_config'); variable_del('taxonomy_tools_role_access_role_config'); } /** * Use vocabulary machine names instead of IDs. */ function taxonomy_tools_role_access_update_7101() { $config = variable_get('taxonomy_tools_role_access_vocab_config', array()); $new_config = array(); foreach ($config as $key => $value) { $query = db_select('taxonomy_vocabulary', 'foo'); $query->addField('foo', 'machine_name'); $query->condition('foo.vid', $key); $machine_name = $query->execute()->fetchField(); if ($key == $value) { $new_config[$machine_name] = $machine_name; } else { $new_config[$machine_name] = 0; } } variable_set('taxonomy_tools_role_access_vocab_config', $new_config); }