You are here

function course_update_6130 in Course 7.2

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

Add `hidden` column to course_outline, add `created` column to course_enrollment. Add serialized `data` column to course_outline.

File

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

Code

function course_update_6130() {
  $ret = array();
  if (!db_field_exists('course_outline', 'hidden')) {
    db_add_field('course_outline', 'hidden', array(
      'type' => 'int',
      'size' => 'tiny',
      'not null' => TRUE,
      'unsigned' => TRUE,
      'default' => 0,
    ));
  }
  if (!db_field_exists('course_enrolment', 'created')) {
    db_add_field('course_enrolment', 'created', array(
      'type' => 'int',
      'not null' => TRUE,
      'unsigned' => TRUE,
      'default' => 0,
    ));
  }
  if (!db_field_exists('course_outline', 'data')) {
    db_add_field('course_outline', 'data', array(
      'type' => 'text',
      'serialize' => TRUE,
    ));
  }

  // 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.');
}