You are here

function quiz_update_7501 in Quiz 7.6

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

Add new result_answer_id field to the quiz_node_results_answers table.

File

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

Code

function quiz_update_7501() {
  db_drop_primary_key('quiz_node_results_answers');
  db_add_unique_key('quiz_node_results_answers', 'result_answer', array(
    'result_id',
    'question_nid',
    'question_vid',
  ));
  $spec = array(
    'description' => 'The result answer ID.',
    'type' => 'serial',
    'unsigned' => TRUE,
    'not null' => TRUE,
  );
  db_add_field('quiz_node_results_answers', 'result_answer_id', $spec, array(
    'primary key' => array(
      'result_answer_id',
    ),
  ));
  return t('Added new result_answer_id field to the quiz_node_results_answers table.');
}