You are here

function quiz_update_7502 in Quiz 7.6

Same name and namespace in other branches
  1. 7.5 quiz.install \quiz_update_7502()

Add new qnr_id field to the quiz_node_relationship table.

File

./quiz.install, line 823
Quiz install schema for installing the quiz module

Code

function quiz_update_7502() {
  db_drop_primary_key('quiz_node_relationship');
  db_add_unique_key('quiz_node_relationship', 'parent_child', array(
    'parent_nid',
    'parent_vid',
    'child_nid',
    'child_vid',
  ));
  $spec = array(
    'type' => 'serial',
    'size' => 'normal',
    'unsigned' => TRUE,
    'not null' => TRUE,
  );
  db_add_field('quiz_node_relationship', 'qnr_id', $spec, array(
    'primary key' => array(
      'qnr_id',
    ),
  ));
  return t('Added new qnr_id field to the quiz_node_relationship table.');
}