You are here

function course_update_6124 in Course 7

Same name and namespace in other branches
  1. 6 course.install \course_update_6124()
  2. 7.2 course.install \course_update_6124()

Add date started field to to fulfillment, add duration to course outline object, remove type field.

File

./course.install, line 598
course.install Install and update functions for Courses.

Code

function course_update_6124() {
  $ret = array();
  if (!db_field_exists('course_outline_fulfillment', 'date_started')) {
    db_add_field('course_outline_fulfillment', 'date_started', array(
      'type' => 'int',
      'not null' => FALSE,
      'unsigned' => TRUE,
      'default' => NULL,
      'description' => 'Date object was started.',
    ));
  }
  db_add_field('course_outline', 'duration', array(
    'type' => 'int',
    'not null' => TRUE,
    'default' => 0,
    'description' => 'Amount of time in seconds a user has to access this object.',
  ));
  db_drop_field('course_node', 'type');

  // hook_update_N() no longer returns a $ret array. Instead, return
  // nothing or a translated string indicating the update ran successfully.
  // See http://drupal.org/node/224333#update_sql.
  return t('TODO Add a descriptive string here to show in the UI.');
}