You are here

function course_update_6132 in Course 7

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

Remove old lms settings. Add new course outline display handler settings.

File

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

Code

function course_update_6132() {
  $ret = array();

  // Delete old lms variables.
  $types = node_type_get_names();
  foreach (array_keys($types) as $type) {
    variable_del("default_lms_{$type}");
  }

  // Migrate old lms column.
  db_change_field('course_node', 'lms', 'outline', array(
    'type' => 'varchar',
    'length' => 255,
    'not null' => TRUE,
    'default' => '',
  ));

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